making a device disapear as soon as it collides with a player

i want to make a trigger device disapear as soon as it collides with a player. i thought of implementing the disapearing by just teleporting the trigger away for example multiplying the vectors with a constant.

(pseudo)verse code:
trigger.TriggeredEvent.Subscribe(OnTriggered)

OnTriggered(trigger)… void=
if(trigger.TeleportTo[position*1000.0,rotation])

the problem is it gives me a error with something about suspends. anyone have coding suggestions/implementations

is that your full code?? your missing a lot of the bulk

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

GameManager_Disapearing := class(creative_device):
#change to whatever device you want to disappear
   @editable
   whatverdeviceyouwanttohide: device_device = device_device{}

   HideTrigger:trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void=
         HideTrigger.TriggeredEvent.Subscribe(HideDevice)

    HideDevice():void=
        spawn:
            HideOnTrigger()  #we need to spawn <suspends> functions

    HideOnTrigger()<suspends>:void=
    whatverdeviceyouwanttohide.Hide<public>():void = external {}
    Sleep(4.0)
    whatverdeviceyouwanttohide.Show<public>():void = external {}

this wont work but definitely gets you a whole lot closer then whatever AI gave you in that last string. this essentially is just a make device disappear button, as its not set up to make whatever you touch disappear, but whenever that bound trigger gets triggered it would make the disappear. Im sure the logic for sending signals on player collosion is there I just dont know it - if you get stuck you can always set the device to have no colloision and put a volume in it that sends a signal to your game manager that then in turn either disables or make it go somewhere You also cant hide devices using Hide():void = external {} so setting it to teleport might be the move however I found it quite difficult to move things with verse so good luck

my code:

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

See Create Your Own Device Using Verse for how to create a verse device.

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

trigger_logic_device := class(creative_device):
@editable
var device : trigger_device = trigger_device{}

on collision detection: Position ändern

nach 10 sekunden neue Position

OnBegin<override>()<suspends>:void=
    device.TriggeredEvent.Subscribe(OnTriggered)
    RotateDevice(device)

OnTriggered(Devices : trigger_device)<suspends> :void=
    Despawn(Devices)


RotateDevice(Devices : trigger_device)<suspends> : void=
    Transform := Devices.GetTransform()
    Position := Transform.Translation
    Rotation := Transform.Rotation
    NewRotation := Rotation.ApplyYaw(180.0)
    MoveResult := Devices.MoveTo(Position, NewRotation, 2.0)
    if(MoveResult = move_to_result.DestinationReached):
        RotateDevice(Devices)

Despawn(Devices : trigger_device)<suspends> :void=
    Transform := device.GetTransform()
    Position := Transform.Translation
    NewPosition := vector3{X := 3000.5, Y := 7000.5, Z := 0.0}
    FinalLocation := vector3{X := Position.X, Y := Position.Y, Z := 0.0}
    Rotation := Transform.Rotation
    Sleep(10.0)
    if(device.TeleportTo[NewPosition,Rotation]){}
    
    if(device.TeleportTo[Position,Rotation]){}

error message:
for line “device.TriggeredEvent.Subscribe(OnTriggered)” the “OnTriggered” is marked with the message:
“This function parameter expects a value of type ?agent->void, but this argument is an incompatible value of type type{_(:trigger_device):void}.(3509)” do you know how to fix it?
what i thought of in this code is if the trigger is triggered (so it basically collided with a player) then i want it to teleport to somewhere it cant be seen and after 10 seconds it teleports back to its original position