docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IXRDropTransformer

    An interface that allows the target position, rotation, and scale of an XRGrabInteractable to be calculated. This interface adds the ability for the grab transformer to be notified when the interactable is dropped and to process once more.

    Inherited Members
    IXRGrabTransformer.canProcess
    IXRGrabTransformer.OnLink(XRGrabInteractable)
    IXRGrabTransformer.OnGrab(XRGrabInteractable)
    IXRGrabTransformer.OnGrabCountChanged(XRGrabInteractable, Pose, Vector3)
    IXRGrabTransformer.Process(XRGrabInteractable, XRInteractionUpdateOrder.UpdatePhase, ref Pose, ref Vector3)
    IXRGrabTransformer.OnUnlink(XRGrabInteractable)
    Namespace: UnityEngine.XR.Interaction.Toolkit.Transformers
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public interface IXRDropTransformer : IXRGrabTransformer

    Properties

    canProcessOnDrop

    Whether this grab transformer opts-in to allowing Process(XRGrabInteractable, UpdatePhase, ref Pose, ref Vector3) to be called by Unity once more after the interactable is deselected by all interactors.

    Declaration
    bool canProcessOnDrop { get; }
    Property Value
    Type Description
    bool
    Remarks

    When the grab transformer implements this interface and this property and canProcess both returns true, the Process(XRGrabInteractable, UpdatePhase, ref Pose, ref Vector3) method will be called once more after OnDrop(XRGrabInteractable, DropEventArgs).

    See Also
    canProcess
    Process(XRGrabInteractable, UpdatePhase, ref Pose, ref Vector3)

    Methods

    OnDrop(XRGrabInteractable, DropEventArgs)

    Called by Unity when the given Interactable is dropped (in other words, when exiting the Select state). This method won't be called until the Interactable is released by every Interactor. Use this to do any code deinitialization based on the interactable being dropped.

    Declaration
    void OnDrop(XRGrabInteractable grabInteractable, DropEventArgs args)
    Parameters
    Type Name Description
    XRGrabInteractable grabInteractable

    The XR Grab Interactable being dropped.

    DropEventArgs args

    The event args associated with the select exit event.

    Remarks

    In other words, this will be called when the selection count changes from 1 to 0.
    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnGrab(XRGrabInteractable)
    Drop()

    See Also

    IXRGrabTransformer
    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)