-
Notifications
You must be signed in to change notification settings - Fork 5
Callback Script
The callbackScript field on an UdonBehaviour is an optional script to receive events when a player or object is teleported.
Parameters are provided by updating variables on the callback script. (For Udon Graph compatibility.) Variables are set on the callback script immediately before the event is emitted.
Not all events or variables need to exist on the callback script; the callback script can just include the events and variables it cares about.
Here is the list of events:
This event is sent by a portal when the local player has walked through the portal and the portal is about to teleport the player to its partner. The player has not yet been moved when this event is sent. The event is sent with the Update timing.
Parameters:
-
sourcePortal(typePortalBehaviour): The portal which the player walked into.
This event is sent by a portal when an object has fallen through the portal and the portal is about to teleport the object to its partner. The object has not yet been moved when this event is sent. The event is sent with the FixedUpdate timing.
Parameters:
-
sourcePortal(typePortalBehaviour): The portal which the object fell into. -
teleportedObject(typeRigidbody): The affected Rigidbody.
This event is sent by a portal when the local player will be teleported to it. (Note that if a portal sends a player to a bare Transform, not another portal, this event will not be emitted because there is no portal to emit it!) This event is sent immediately after the sender portal emits _PortalWillTeleportPlayer, before the player has been moved.
Parameters:
-
sourcePortal(typePortalBehaviour): The portal which the player walked into. -
targetPortal(typePortalBehaviour): The portal receiving the player (i.e. the portal which emits this event).
This event is sent by a portal when an object will be teleported to it. (Note that if a portal sends an object to a bare Transform, not another portal, this event will not be emitted because there is no portal to emit it!) This event is sent immediately after the sender portal emits _PortalWillTeleportObject, before the object has been moved.
Parameters:
-
sourcePortal(typePortalBehaviour): The portal which the object fell into. -
targetPortal(typePortalBehaviour): The portal receiving the object (i.e. the portal which emits this event). -
teleportedObject(typeRigidbody): The affected Rigidbody.