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

TeleportInteractable Class

A target to which a TeleportInteractor can teleport.
This class encapsulates the target-specific information the teleportation interaction needs in order to execute properly, including the location, targeting information, and optionally details about how the player should be positioned after teleport.

Properties

AllowTeleport : bool
[Get][Set]
Indicates if the interactable is valid for teleport.
Setting it to false can be convenient to block the arc (this will cause TeleportInteractor.HasValidDestination to return false).
Signature
bool Oculus.Interaction.Locomotion.TeleportInteractable.AllowTeleport
EqualDistanceToBlockerOverride : float
[Get][Set]
An override for the Interactor EqualDistanceThreshold used when comparing the interactable against other interactables that do not allow teleport.
This can allow an interactable to more easily "present itself as equidistant" to something else, increasing the ease of selecting it specifically in preference to other interactions.
Signature
float Oculus.Interaction.Locomotion.TeleportInteractable.EqualDistanceToBlockerOverride
EyeLevel : bool
[Get][Set]
Allows overriding the default teleport behavior, which aligns the user's feet/floor with the teleport target, to instead align the user's head/eyes to the target.
This is useful for scenarios such as a "hotspot" in front of a window, where the goal is to make it easy for the player to quickly stand in a certain spot and see something specific. Note that this setting is only meaningful if a target point is supplied (see TargetPose(Pose)).
Signature
bool Oculus.Interaction.Locomotion.TeleportInteractable.EyeLevel
FaceTargetDirection : bool
[Get][Set]
Specifies whether teleporting to this interactable should override the player's orientation to match that of the target point (see TargetPose(Pose)).
This is useful for scenarios such as a "hotspot" in front of a control panel, where the goal is to make it easy for the player to quickly stand in a certain spot facing a certain direction. Note that this setting is only meaningful if a target point is supplied.
Signature
bool Oculus.Interaction.Locomotion.TeleportInteractable.FaceTargetDirection
Surface : ISurface
[Get]
The surface against which the interactor will check collisions with TeleportInteractor.TeleportArc.
By default, the precise collision point will be treated as the teleport target destination, which is useful when specifying a single large teleport target (such as the floor of a room) as a single interactable. However, this can be overridden by supplying a target point (see TargetPose(Pose)), which if provided will supersede the actual collision and allow the interactable to function as a "hotspot" target moving the player to a specific location.
Signature
ISurface Oculus.Interaction.Locomotion.TeleportInteractable.Surface
SurfaceBounds : IBounds
[Get]
The bounds constraining the region from which this interactable can be targeted.
This can be used to disallow targeting of an interactable from beyond a certain range.
Signature
IBounds Oculus.Interaction.Locomotion.TeleportInteractable.SurfaceBounds
TieBreakerScore : int
[Get][Set]
Establishes the priority when several interactables are hit at the same time (EqualDistanceThreshold) by the arc.
Overriding equivalence comparison with EqualDistanceToBlockerOverride will cause this value to be consulted more frequently.
Signature
int Oculus.Interaction.Locomotion.TeleportInteractable.TieBreakerScore

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.Locomotion.TeleportInteractable.Awake()
Returns
override void
Start ()
Signature
override void Oculus.Interaction.Locomotion.TeleportInteractable.Start()
Returns
override void

Methods

DetectHit ( from , to , hit )
Detects a hit from the teleport raycast on the object.
Signature
bool Oculus.Interaction.Locomotion.TeleportInteractable.DetectHit(Vector3 from, Vector3 to, out TeleportHit hit)
Parameters
from: Vector3  The origin, in world space from which to cast the ray
to: Vector3  The target, in world space, through which the cast ray should pass(in
hit: out TeleportHit  Information about the hit, if one occurred
Returns
bool  True if a hit was detected, false otherwise
InjectAllTeleportInteractable ( surface )
Injects all required dependencies for a dynamically instantiated TeleportInteractable; effectively wraps InjectSurface(ISurface), 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.
Signature
void Oculus.Interaction.Locomotion.TeleportInteractable.InjectAllTeleportInteractable(ISurface surface)
Parameters
surface: ISurface
Returns
void
InjectOptionalTargetPoint ( targetPoint )
Sets the target point (see TargetPose(Pose) for a dynamically instantiated TeleportInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Locomotion.TeleportInteractable.InjectOptionalTargetPoint(Transform targetPoint)
Parameters
targetPoint: Transform
Returns
void
InjectSurface ( surface )
Sets an ISurface for a dynamically instantiated TeleportInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Locomotion.TeleportInteractable.InjectSurface(ISurface surface)
Parameters
surface: ISurface
Returns
void
IsInRange ( origin , maxSqrDistance )
Determines if a TeleportInteractor is close enough to target this interactable.
This is called by internal logic of TeleportInteractor and should not be invoked independently.
Signature
bool Oculus.Interaction.Locomotion.TeleportInteractable.IsInRange(in Pose origin, float maxSqrDistance)
Parameters
origin: in Pose
maxSqrDistance: float
Returns
bool
TargetPose ( hitPose )
Used when the interactor is looking for a teleport target.
If you specify a target point, it'll use that. Otherwise it uses wherever the teleport arc is pointing.
Signature
Pose Oculus.Interaction.Locomotion.TeleportInteractable.TargetPose(Pose hitPose)
Parameters
hitPose: Pose
Returns
Pose