i want to make a trigger disappear as soon as a player collides with it. anyone know how i would have to modify this code so it despawns on the collision (the despawning method has already been implemented i just want to know how to do the colliding part)
despawning code:
Despawn(Devices : trigger_device) :void=
Transform := device.GetTransform()
Position := Transform.Translation
NewPosition := vector3{X := 3000.5, Y := 7000.5, Z := 0.0}
Rotation := Transform.Rotation
if(device.TeleportTo[NewPosition,Rotation]){}
basically teleporting the trigger out of sight. how to implement the despawning only on collision