and this is the super simplified attempt to use MoveTo
Same results: compiles, runs in game, computes… still prop snaps back to original position.
Feels like a hardcoded limitation somewhere in UEFN. Would be nice to know if it is.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
# This class defines a device that makes a cube follow the player
FollowPlayerMoveTo := class(creative_device):
@editable
Cube : creative_prop = creative_prop{}
@editable
VolumeTrigger: volume_device = volume_device{}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Print("Device initialized and waiting for player to enter volume.", ?Duration := 6.0)
VolumeTrigger.AgentEntersEvent.Subscribe(TriggerWakeupAsync)
# Function to handle the event asynchronously
TriggerWakeupAsync(InPlayer:agent):void =
spawn{TriggerWakeup(InPlayer)}
# Async function that handles the logic when a player enters the volume
TriggerWakeup(InPlayer:agent)<suspends>:void =
if (FortCharacter := InPlayer.GetFortCharacter[]):
Print("Player entered volume and attached!", ?Duration := 6.0)
FollowPlayer(FortCharacter)
# Function to make the cube follow the player
FollowPlayer(Player:fort_character)<suspends>:void=
loop:
PlayerPosition := Player.GetTransform().Translation
PlayerRotation := Player.GetTransform().Rotation
Cube.MoveTo(PlayerPosition, PlayerRotation, 2.0)
Sleep(1.0) # Adjust the delay as necessary