docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BaseTeleportationInteractable

    This is intended to be the base class for all Teleportation Interactables. This abstracts the teleport request process for specializations of this class.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRBaseInteractable
    BaseTeleportationInteractable
    TeleportationAnchor
    TeleportationArea
    TeleportationMultiAnchorVolume
    Implements
    IXRActivateInteractable
    IXRHoverInteractable
    IXRSelectInteractable
    IXRFocusInteractable
    IXRInteractionStrengthInteractable
    IXRInteractable
    IXROverridesGazeAutoSelect
    IXRReticleDirectionProvider
    Inherited Members
    XRBaseInteractable.registered
    XRBaseInteractable.unregistered
    XRBaseInteractable.getDistanceOverride
    XRBaseInteractable.interactionManager
    XRBaseInteractable.colliders
    XRBaseInteractable.interactionLayers
    XRBaseInteractable.distanceCalculationMode
    XRBaseInteractable.selectMode
    XRBaseInteractable.focusMode
    XRBaseInteractable.customReticle
    XRBaseInteractable.allowGazeInteraction
    XRBaseInteractable.allowGazeSelect
    XRBaseInteractable.overrideGazeTimeToSelect
    XRBaseInteractable.gazeTimeToSelect
    XRBaseInteractable.overrideTimeToAutoDeselectGaze
    XRBaseInteractable.timeToAutoDeselectGaze
    XRBaseInteractable.allowGazeAssistance
    XRBaseInteractable.firstHoverEntered
    XRBaseInteractable.lastHoverExited
    XRBaseInteractable.hoverEntered
    XRBaseInteractable.hoverExited
    XRBaseInteractable.firstSelectEntered
    XRBaseInteractable.lastSelectExited
    XRBaseInteractable.selectEntered
    XRBaseInteractable.selectExited
    XRBaseInteractable.firstFocusEntered
    XRBaseInteractable.lastFocusExited
    XRBaseInteractable.focusEntered
    XRBaseInteractable.focusExited
    XRBaseInteractable.activated
    XRBaseInteractable.deactivated
    XRBaseInteractable.interactorsHovering
    XRBaseInteractable.isHovered
    XRBaseInteractable.interactorsSelecting
    XRBaseInteractable.firstInteractorSelecting
    XRBaseInteractable.isSelected
    XRBaseInteractable.interactionGroupsFocusing
    XRBaseInteractable.firstInteractionGroupFocusing
    XRBaseInteractable.isFocused
    XRBaseInteractable.canFocus
    XRBaseInteractable.startingHoverFilters
    XRBaseInteractable.hoverFilters
    XRBaseInteractable.startingSelectFilters
    XRBaseInteractable.selectFilters
    XRBaseInteractable.startingInteractionStrengthFilters
    XRBaseInteractable.interactionStrengthFilters
    XRBaseInteractable.largestInteractionStrength
    XRBaseInteractable.OnEnable()
    XRBaseInteractable.OnDisable()
    XRBaseInteractable.OnDestroy()
    XRBaseInteractable.GetAttachTransform(IXRInteractor)
    XRBaseInteractable.GetAttachPoseOnSelect(IXRSelectInteractor)
    XRBaseInteractable.GetLocalAttachPoseOnSelect(IXRSelectInteractor)
    XRBaseInteractable.GetDistanceSqrToInteractor(IXRInteractor)
    XRBaseInteractable.GetDistance(Vector3)
    XRBaseInteractable.GetInteractionStrength(IXRInteractor)
    XRBaseInteractable.IsHoverableBy(IXRHoverInteractor)
    XRBaseInteractable.IsHovered(IXRHoverInteractor)
    XRBaseInteractable.IsSelected(IXRSelectInteractor)
    XRBaseInteractable.IsHovered(IXRInteractor)
    XRBaseInteractable.IsSelected(IXRInteractor)
    XRBaseInteractable.GetCustomReticle(IXRInteractor)
    XRBaseInteractable.AttachCustomReticle(IXRInteractor)
    XRBaseInteractable.RemoveCustomReticle(IXRInteractor)
    XRBaseInteractable.CaptureAttachPose(IXRSelectInteractor)
    XRBaseInteractable.OnRegistered(InteractableRegisteredEventArgs)
    XRBaseInteractable.OnUnregistered(InteractableUnregisteredEventArgs)
    XRBaseInteractable.OnHoverEntering(HoverEnterEventArgs)
    XRBaseInteractable.OnHoverEntered(HoverEnterEventArgs)
    XRBaseInteractable.OnHoverExiting(HoverExitEventArgs)
    XRBaseInteractable.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractable.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractable.OnSelectExiting(SelectExitEventArgs)
    XRBaseInteractable.OnFocusEntering(FocusEnterEventArgs)
    XRBaseInteractable.OnFocusEntered(FocusEnterEventArgs)
    XRBaseInteractable.OnFocusExiting(FocusExitEventArgs)
    XRBaseInteractable.OnFocusExited(FocusExitEventArgs)
    XRBaseInteractable.ProcessInteractionStrength(XRInteractionUpdateOrder.UpdatePhase)
    XRBaseInteractable.ProcessHoverFilters(IXRHoverInteractor)
    XRBaseInteractable.ProcessSelectFilters(IXRSelectInteractor)
    XRBaseInteractable.ProcessInteractionStrengthFilters(IXRInteractor, float)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion.Teleportation
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
    public abstract class BaseTeleportationInteractable : XRBaseInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRFocusInteractable, IXRInteractionStrengthInteractable, IXRInteractable, IXROverridesGazeAutoSelect, IXRReticleDirectionProvider

    Properties

    filterSelectionByHitNormal

    When set to true, this teleportation interactable will only be selectable by a ray interactor if its current hit normal is aligned with this object's up vector.

    Declaration
    public bool filterSelectionByHitNormal { get; set; }
    Property Value
    Type Description
    bool
    See Also
    upNormalToleranceDegrees

    matchDirectionalInput

    Whether or not to rotate the rig to match the forward direction of the attach transform of the selecting interactor. This only applies when matchOrientation is set to WorldSpaceUp or TargetUp.

    Declaration
    public bool matchDirectionalInput { get; set; }
    Property Value
    Type Description
    bool

    matchOrientation

    How to orient the rig after teleportation.

    Declaration
    public MatchOrientation matchOrientation { get; set; }
    Property Value
    Type Description
    MatchOrientation
    Remarks

    Set to:

    • WorldSpaceUp to stay oriented according to the world space up vector.
    • TargetUp to orient according to the target BaseTeleportationInteractable Transform's up vector.
    • TargetUpAndForward to orient according to the target BaseTeleportationInteractable Transform's rotation.
    • None to maintain the same orientation before and after teleporting.

    teleportTrigger

    Specifies when the teleportation triggers.

    Declaration
    public BaseTeleportationInteractable.TeleportTrigger teleportTrigger { get; set; }
    Property Value
    Type Description
    BaseTeleportationInteractable.TeleportTrigger

    teleportationProvider

    The teleportation provider that this teleportation interactable communicates teleport requests to. If no teleportation provider is configured, will attempt to find a teleportation provider.

    Declaration
    public TeleportationProvider teleportationProvider { get; set; }
    Property Value
    Type Description
    TeleportationProvider

    teleporting

    Gets or sets the event that Unity calls when queuing to teleport via the TeleportationProvider.

    Declaration
    public TeleportingEvent teleporting { get; set; }
    Property Value
    Type Description
    TeleportingEvent
    Remarks

    The TeleportingEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.

    upNormalToleranceDegrees

    The tolerance in degrees from this object's up vector for a hit normal to be considered aligned with the up vector.

    Declaration
    public float upNormalToleranceDegrees { get; set; }
    Property Value
    Type Description
    float
    See Also
    filterSelectionByHitNormal

    Methods

    Awake()

    See MonoBehaviour.

    Declaration
    protected override void Awake()
    Overrides
    XRBaseInteractable.Awake()

    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 virtual 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
    bool

    Returns true if the teleport request was successfully updated and should be queued. Otherwise, returns false.

    See Also
    QueueTeleportRequest(TeleportRequest)

    GetReticleDirection(IXRInteractor, Vector3, out Vector3, out Vector3?)

    Get the reticle direction based on the given interactor's attach transform.

    Declaration
    public void GetReticleDirection(IXRInteractor interactor, Vector3 hitNormal, out Vector3 reticleUp, out Vector3? optionalReticleForward)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The interactor whose attach transform determines the reticle direction.

    Vector3 hitNormal

    The normal of the surface the reticle is placed on. This is the default value for reticleUp if the provider does not specify up directionality.

    Vector3 reticleUp

    The returned up direction of the reticle.

    Vector3? optionalReticleForward

    The returned forward direction which will be projected onto the plane defined by reticleUp to determine the reticle's actual forward direction. This will be null if the provider does not specify forward directionality.

    IsSelectableBy(IXRSelectInteractor)

    Determines if a given Interactor can select this Interactable.

    Declaration
    public override bool IsSelectableBy(IXRSelectInteractor interactor)
    Parameters
    Type Name Description
    IXRSelectInteractor interactor

    Interactor to check for a valid selection with.

    Returns
    Type Description
    bool

    Returns true if selection is valid this frame. Returns false if not.

    Overrides
    XRBaseInteractable.IsSelectableBy(IXRSelectInteractor)
    See Also
    CanSelect(IXRSelectInteractable)

    OnActivated(ActivateEventArgs)

    XRBaseInputInteractor calls this method when the Interactor begins an activation event on this Interactable.

    Declaration
    protected override void OnActivated(ActivateEventArgs args)
    Parameters
    Type Name Description
    ActivateEventArgs args

    Event data containing the Interactor that is sending the activate event.

    Overrides
    XRBaseInteractable.OnActivated(ActivateEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnDeactivated(DeactivateEventArgs)

    OnDeactivated(DeactivateEventArgs)

    XRBaseInputInteractor calls this method when the Interactor ends an activation event on this Interactable.

    Declaration
    protected override void OnDeactivated(DeactivateEventArgs args)
    Parameters
    Type Name Description
    DeactivateEventArgs args

    Event data containing the Interactor that is sending the deactivate event.

    Overrides
    XRBaseInteractable.OnDeactivated(DeactivateEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnActivated(ActivateEventArgs)

    OnSelectEntered(SelectEnterEventArgs)

    The XRInteractionManager calls this method when the Interactor first initiates selection of an Interactable in a second pass.

    Declaration
    protected override void OnSelectEntered(SelectEnterEventArgs args)
    Parameters
    Type Name Description
    SelectEnterEventArgs args

    Event data containing the Interactor that is initiating the selection.

    Overrides
    XRBaseInteractable.OnSelectEntered(SelectEnterEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnSelectExited(SelectExitEventArgs)

    OnSelectExited(SelectExitEventArgs)

    The XRInteractionManager calls this method when the Interactor ends selection of an Interactable in a second pass.

    Declaration
    protected override void OnSelectExited(SelectExitEventArgs args)
    Parameters
    Type Name Description
    SelectExitEventArgs args

    Event data containing the Interactor that is ending the selection.

    Overrides
    XRBaseInteractable.OnSelectExited(SelectExitEventArgs)
    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnSelectEntered(SelectEnterEventArgs)

    ProcessInteractable(UpdatePhase)

    The XRInteractionManager calls this method to update the Interactable.

    Declaration
    public override void ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase

    The update phase this is called during.

    Overrides
    XRBaseInteractable.ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)
    Remarks

    Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.

    See Also
    XRInteractionUpdateOrder.UpdatePhase
    ProcessInteractor(UpdatePhase)

    Reset()

    See MonoBehaviour.

    Declaration
    protected override void Reset()
    Overrides
    XRBaseInteractable.Reset()

    SendTeleportRequest(IXRInteractor)

    Queues a request to teleport. This method can be called from script to initiate teleportation manually rather than relying on the interaction system to initiate teleportation.

    Declaration
    protected bool SendTeleportRequest(IXRInteractor interactor)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The interactor, if any, that initiated the teleport trigger. If null, the teleport request will be generated without a raycast hit.

    Returns
    Type Description
    bool

    Returns true if successfully queued. Otherwise, returns false.

    Remarks

    Due to script execution order of the TeleportationProvider, depending on when this method is called, teleportation of the XR Origin may not occur until the next frame.

    Implements

    IXRActivateInteractable
    IXRHoverInteractable
    IXRSelectInteractable
    IXRFocusInteractable
    IXRInteractionStrengthInteractable
    IXRInteractable
    IXROverridesGazeAutoSelect
    IXRReticleDirectionProvider

    Extension Methods

    XRFocusInteractableExtensions.GetOldestInteractorFocusing(IXRFocusInteractable)
    XRHoverInteractableExtensions.GetOldestInteractorHovering(IXRHoverInteractable)
    XRHoverInteractableExtensions.IsHoveredByLeft(IXRHoverInteractable)
    XRHoverInteractableExtensions.IsHoveredByRight(IXRHoverInteractable)
    XRSelectInteractableExtensions.GetOldestInteractorSelecting(IXRSelectInteractable)
    XRSelectInteractableExtensions.IsSelectedByLeft(IXRSelectInteractable)
    XRSelectInteractableExtensions.IsSelectedByRight(IXRSelectInteractable)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)