VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse UEFN›Spawning·Up to UEFN · Spawning·4 of 18 in Spawning

Subscribe to Player Spawn Events

3. Subscribing to Player Events

This step shows how to assign a weapon to a player at the start of the game.

This step shows how to assign a weapon to a player at the start of the game.

When a player spawns for the first time, grant them the first weapon in the WeaponGranters array. To do this, you’ll need to subscribe functions to each player spawn pad. See the Coding Device Interactions page for more details on subscribable events.

Follow these steps to subscribe to player spawn events and to assign their first weapon.

  1. Add a new method OnPlayerSpawn() to the team_elimination_game class. This method makes sure that you assign the player the right weapon when they spawn for the first time, and when they respawn.

    
    
    |  | OnPlayerSpawn(InPlayer : agent) : void = |
    | --- | --- |
    |  | Print("A Player just spawned!") |
    
    Copy full snippet
    
  2. To subscribe the functions you just set up to their associated events, you need to add new code to OnBegin(). Create a for loop to subscribe to each player spawner’s SpawnedEvent using OnPlayerSpawn.

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Spawning · 4 of 18
Prev
spawn in verse
Next
ball spawner device
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2024-12-05T00:00:00+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse