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

TeleportInteractor Class

TeleportInteractor uses a provided IPolyline teleport arc and an external ISelector to find the best TeleportInteractable 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 as a default.
(Meters, World) The threshold below which distances to an 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 IHmd (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.
This pose is calculated from the IPolyline provided as the TeleportArc.
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.
Implementation of ILocomotionEventBroadcaster.WhenLocomotionPerformed; for details, please refer to the related documentation provided for that interface.
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.

Fields

The most recent calculated endpoint of the teleport arc.
This property can change and/or linger on old values with unspecified timing depending on the internal state of the TeleportInteractor, so it should not be relied on for anything other than rendering visualizations.

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 Interactor<TInteractor, TInteractable>.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 of Interactor<TInteractor, TInteractable>.CanSelect(TInteractable); for details, please refer to the related documentation provided for that method.
Checks whether the interactor current has a target TeleportInteractable to which it can legitimiately travel.
Returns
True if there is a current target and that target can be teleported to, false otherwise
Injects all required dependencies for a dynamically instantiated TeleportInteractor; effectively wraps InjectSelector(ISelector), since all other dependencies are optional.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets an ISelector for a dynamically instantiated TeleportInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Obsolete method: provide a ComputeCandidateDelegate instead.
Sets an IHmd for a dynamically instantiated TeleportInteractor. This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the IPolyline teleport arc for a dynamically instantiated TeleportInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets a custom strategy for computing the best teleport candidate for a dynamically instantiated TeleportInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.

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