# Make a prop follow the instigator player

**URL:** <https://forums.unrealengine.com/t/make-a-prop-follow-the-instigator-player/1226403>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [July 11, 2023, 9:53pm UTC](https://forums.unrealengine.com/t/make-a-prop-follow-the-instigator-player/1226403 "2023-07-11T21:53:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DuoFreeper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/duofreeper/32/761329_2.png) [@DuoFreeper](https://forums.unrealengine.com/u/DuoFreeper)\
**Post date:** [July 11, 2023, 9:53pm UTC](https://forums.unrealengine.com/t/make-a-prop-follow-the-instigator-player/1226403/1 "2023-07-11T21:53:11Z")

</div>

Im trying to make a code that follows the current instigator of the trigger , it suppost to change the player once a new instigator active it, but now i dont have any visual error but and isnt working

```auto

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

# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.

# A Verse-authored creative device that can be placed in a level
seguir_jugadores := class(creative_device):
   @editable MyTrigger : trigger_device = trigger_device{}
   @editable Prop : creative_prop = creative_prop{}

   var SelectedPlayer : []fort_character = array{}
   var StopChasing : logic = false
  
   OnBegin<override>()<suspends>:void=
       MyTrigger.TriggeredEvent.Subscribe(HandleTrigger)
       ChasePlayer(Prop)

   HandleTrigger(MaybeAgent:?agent):void=
       if(Agent:=MaybeAgent?,Player:=Agent.GetFortCharacter[]):
           if(set SelectedPlayer[0] = Player){}
       
            

   ChasePlayer(Enemy : creative_prop)<suspends>:void=
       var PreviousTime : float = GetSimulationElapsedTime()
           MoveSpeed := 0.1

           loop:
               Sleep(0.0)
               if(PlayerCharacter := SelectedPlayer[0]):
                      
                       CurrentTime := GetSimulationElapsedTime()
                       DeltaTime := CurrentTime - PreviousTime
                       set PreviousTime = CurrentTime
                       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]

```

---

<div class="post-metadata">

**Author:** ![Acid9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Acid9](https://forums.unrealengine.com/u/Acid9)\
**Post date:** [November 30, 2023, 10:00am UTC](https://forums.unrealengine.com/t/make-a-prop-follow-the-instigator-player/1226403/2 "2023-11-30T10:00:15Z")

</div>

call ChasePlayer(Prop) from within Handle Trigger, you are losing your Agent scope by doing it outside of the listener
