

if(TeleportProp.TeleportTo[PositionProp,RotationProp]){}
Because the .TeleportTo[]
is a failable/decides function and you need to put it inside an if in case it will fail
Thanks a lot, but I still need something different. Right now the script only teleports the object after a delay ( sleep(3.0) ), but I need it to teleport when a chosen device or prop in the scene changes state (like when a trigger is activated), and not just in one direction but also back, depending on which device I select. Something like in this picture. I also wrote the comments (#) below the code what the code is supposed to do.
add a
@editable Trigger : trigger_device = trigger_device{}
replace OnBegin with
OnBegin<override>()<suspends>:void=
Trigger.TriggeredEvent.Subscribe(MoveIt)
and change the top of MoveIt to
MoveIt(MaybeAgent:?agent):void=