Verse Library verse

02 Fragment

Waits for a ball spawn, then tracks overlaps to eliminate players upon capture.

verse-library/ball-spawner-device-design-examples-in-fortnite-creative/02-fragment.verse

#using <Core.h>
#using <CoreGame.h>
#using <Game.h>

#using <Verse.h>

#using <Fortnite.h>
#using <FortniteGame.h>

// We need to reference the Ball Spawner and the Capture Areas
ref BallSpawner := "BallSpawner_1"
ref RedCaptureArea := "CaptureArea_Red"
ref BlueCaptureArea := "CaptureArea_Blue"

#event OnBegin<override>()<suspends> async fun void() {
    // Start the game loop
    while (true) {
        // Wait for the Ball Spawner to spawn a ball
        await BallSpawner.OnSpawned
        
        // Get the ball that was just spawned
        // 'GetLastSpawnedEntity()' is a hypothetical helper for explanation.
        // In reality, you might use a different event binding.
        ball := BallSpawner.GetLastSpawnedEntity()
        
        // Now, we need to listen for the ball hitting a player.
        // We bind the 'OnOverlapStart' event of the Capture Area.
        // When the ball overlaps the Red Capture Area, this triggers.
        await RedCaptureArea.OnOverlapStart

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in