Verse

I am trying to get a monster to chase you when you walk in the mutator zone, but nothing is working at all. I watched a youtube video of a guy that done it and he put the code for the verse in his description and said we could use it, but when I do all my character does is disappears.

Nobody is able to help you if you don’t share your code on the forum

using { /Fortnite.com/Devices }
using {/Fortnite.com/Characters}
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

See Create Your Own Device Using Verse in Unreal Editor for Fortnite | Fortnite Documentation | Epic Developer Community for how to create a verse device.

A Verse-authored creative device that can be placed in a level

scary_game := class(creative_device):

@editable var Monster : creative_prop = creative_prop{}
@editable var MonsterMutator : mutator_zone_device = mutator_zone_device{}
@editable var EndCinematic : cinematic_sequence_device = cinematic_sequence_device{}
@editable var FlashlightGranter : item_granter_device = item_granter_device{}
@editable var GameMusic : audio_player_device = audio_player_device{}
@editable var RadioDeviceGame : radio_device = radio_device{}
@editable var RadioDeviceChase : radio_device = radio_device{}

var MonsterSpottedPlayer : logic = false


OnBegin<override>()<suspends>:void=
    MonsterMutator.AgentEntersEvent.Subscribe(OnPlayerSpotted)
    Players := GetPlayspace().GetPlayers()
        if (Player := Players[0], Agent := agent[Player]):
            GameMusic.Register(Agent)
            RadioDeviceChase.Stop()
            RadioDeviceChase.Register(Agent)
            FlashlightGranter.GrantItem(Agent)


OnPlayerSpotted(Agent : agent):void=
    if (MonsterSpottedPlayer = true):
        Monster.Dispose()
        EndCinematic.Play()

    else:
        RadioDeviceGame.Stop()
        RadioDeviceChase.Play()
        Players := GetPlayspace().GetPlayers()
        if (Player := Players[0]):
            spawn:
                FirstEncounterCooldown()
            spawn:
                FollowPlayer(Monster, Player)


FirstEncounterCooldown()<suspends>:void=
    Sleep(2.0)
    set MonsterSpottedPlayer = true

FollowPlayer(Enemy : creative_prop, Player : player)<suspends>:void=
    var PreviousTime : float = GetSimulationElapsedTime()
        MoveSpeed := 0.1
        loop:
            Sleep(0.0)
            CurrentTime := GetSimulationElapsedTime()
            DeltaTime := CurrentTime - PreviousTime
            set PreviousTime = CurrentTime
            if (PlayerCharacter := Player.GetFortCharacter[], Enemy.IsValid[]):

                PropLocation := Enemy.GetTransform().Translation
                PlayerLocation := PlayerCharacter.GetTransform().Translation

                if (LookDirection := (PlayerLocation - PropLocation).MakeUnitVector[]):

                    Yaw := RadiansToDegrees(ArcTan(LookDirection.Y, LookDirection.X)) - 90.0
                    Pitch := 0.0 #RadiansToDegrees(ArcTan(LookDirection.Z, Sqrt((LookDirection.X * LookDirection.X) + (LookDirection.Y * LookDirection.Y))))
                    Roll := 0.0

                    NewRotation := MakeRotationFromYawPitchRollDegrees(Yaw, Pitch, Roll)

                    # Movement
                    LerpLocation := Lerp(PropLocation, PlayerLocation, DeltaTime * MoveSpeed)
                    FinalLocation := vector3{X := LerpLocation.X, Y := LerpLocation.Y, Z := 0.0}

                    if:
                        Enemy.TeleportTo[FinalLocation, NewRotation]