Class TeleportationAnchor
An anchor is a teleportation destination which teleports the user to a pre-determined specific position and/or rotation.
Inheritance
TeleportationAnchor
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/Teleportation Anchor", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.TeleportationAnchor.html")]
public class TeleportationAnchor : BaseTeleportationInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRInteractable
Properties
teleportAnchorTransform
The Transform that represents the teleportation destination.
Declaration
public Transform teleportAnchorTransform { get; set; }
Property Value
Type | Description |
---|---|
Transform |
Methods
GenerateTeleportRequest(IXRInteractor, RaycastHit, ref TeleportRequest)
Automatically called upon the teleport trigger event occurring to generate the teleport request. The teleportation destination pose should be filled out.
Declaration
protected override bool GenerateTeleportRequest(IXRInteractor interactor, RaycastHit raycastHit, ref TeleportRequest teleportRequest)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The interactor that initiated the teleport trigger. |
RaycastHit | raycastHit | The ray cast hit information from the interactor. |
TeleportRequest | teleportRequest | The teleport request that should be filled out during this method call. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the teleport request was successfully updated and should be queued. Otherwise, returns false. |
Overrides
See Also
OnDrawGizmos()
Unity calls this when drawing gizmos.
Declaration
protected void OnDrawGizmos()
OnValidate()
See MonoBehaviour.
Declaration
protected void OnValidate()
Reset()
See MonoBehaviour.
Declaration
protected override void Reset()