API reference
API reference
Select your platform
No SDKs available
No versions available

TeleportInteractor Class

TeleportInteractor uses a provided ITeleportArc and an external Selector to find the best interactable and emit the event requesting a teleport to it.
By itself it does not define the shape of the arc or even moves the player, instead it is the core class that brings these pieces together.

Properties

Specifies the shape of the arc used for detecting available interactables.
If none is provided TeleportArcGravity will be used.
(Meters, World) The threshold below which distances to a interactable are treated as equal for the purposes of ranking.
When provided, the Interactor will perform an extra check to ensure nothing is blocking the line between the Hmd (head of the player) and the teleport origin (hand).
Making it impossible to teleport if the user is placing their hands behind a virtual wall.
The starting point of the teleport arc.
TeleportHit ArcEnd[Get]
The location to teleport to.
If the interactor has an interactable, then that's the teleport location. Otherwise it just projects the end of the arc onto the ground and uses that as the target.
Action< LocomotionEvent > WhenLocomotionPerformed
This optional delegate method offers one chance to accept or reject a valid target destination.
It will be executed upon the current Interactable and desired target Pose in order to allow selection.Return true to allow Selection, false to disallow selection. When it is not set, it always allows to select valid interactables.

Member Functions

Delegate to accept or reject the selection of teleport destination.
Parameters
interactable
The interactable the interactor wants to teleport to.
destination
The final Pose the interactor wants to move to.
Returns
True if the destination is accepted, false if rejected.
delegate int ComputeCandidateTiebreakerDelegate
Delegate method used for calculating the best available interactable to teleport to.
Implement this delegate to create custom behaviors for the Interactor ComputeCandidate.
Parameters
TeleportArc
The serie of segments used to query the interactables.
interactables
The list of available interactors whitin range of the arc
tiebreaker
Method to break the tie when two interactables get the same result, note that this can be modified externally via Interactor.CandidateTiebreaker
hitPose
The information about where the best candidate was hit
Returns
The best candidate found
override bool CanSelect
( TeleportInteractable interactable )
bool HasValidDestination ( )
Sets all required values for a dynamically instantiated GameObject.
Sets the selection mechanism for a dynamically instantiated GameObject.
Sets the HMD (Head Mounted Display) for a dynamically instantiated GameObject.
Sets the teleport arc for a dynamically instantiated GameObject.
Sets a custom strategy for computing the best teleport candidate.

Protected Functions

virtual override void Awake ( )
virtual override void Start ( )
override void InteractableSelected
( TeleportInteractable interactable )
virtual override TeleportInteractable ComputeCandidate ( )
override int ComputeCandidateTiebreaker
Did you find this page helpful?
Thumbs up icon
Thumbs down icon