Class TeleportationAnchor
An anchor is a teleportation destination which teleports the user to a pre-determined specific position and/or rotation.
Inheritance
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.4/api/UnityEngine.XR.Interaction.Toolkit.TeleportationAnchor.html")]
public class TeleportationAnchor : BaseTeleportationInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRFocusInteractable, IXRInteractionStrengthInteractable, IXRInteractable, IXROverridesGazeAutoSelect, IXRReticleDirectionProvider
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
GetAttachTransform(IXRInteractor)
Gets the Transform that serves as the attachment point for a given Interactor.
Declaration
public override Transform GetAttachTransform(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The specific Interactor as context to get the attachment point for. |
Returns
Type | Description |
---|---|
Transform | Returns the attachment point Transform. |
Overrides
Remarks
This should typically return the Transform of a child GameObject or the transform itself.
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()