docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IConstrainedXRBodyManipulator

    Interface for an object that can perform movement of an XRMovableBody that is constrained by collision based on where the user's body is.

    Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public interface IConstrainedXRBodyManipulator

    Properties

    isGrounded

    Whether the linkedBody is touching the ground, as of the most recent call to MoveBody(Vector3).

    Declaration
    bool isGrounded { get; }
    Property Value
    Type Description
    bool
    See Also
    CharacterControllerBodyManipulator

    lastCollisionFlags

    Flags indicating the direction of the collision from the most recent call to MoveBody(Vector3).

    Declaration
    CollisionFlags lastCollisionFlags { get; }
    Property Value
    Type Description
    CollisionFlags
    See Also
    CharacterControllerBodyManipulator

    linkedBody

    The body whose originTransform to move.

    Declaration
    XRMovableBody linkedBody { get; }
    Property Value
    Type Description
    XRMovableBody
    See Also
    OnLinkedToBody(XRMovableBody)
    OnUnlinkedFromBody()

    Methods

    MoveBody(Vector3)

    Applies the given motion to linkedBody. A collision can constrain the movement from taking place.

    Declaration
    CollisionFlags MoveBody(Vector3 motion)
    Parameters
    Type Name Description
    Vector3 motion

    Amount of translation to apply.

    Returns
    Type Description
    CollisionFlags

    Returns flags that indicate the direction of the collision, if there was one.

    See Also
    CharacterControllerBodyManipulator

    OnLinkedToBody(XRMovableBody)

    Called after the given body links this manipulator to it. The implementation should ensure that linkedBody points to body after this method is called.

    Declaration
    void OnLinkedToBody(XRMovableBody body)
    Parameters
    Type Name Description
    XRMovableBody body

    The body linked with this manipulator.

    See Also
    LinkConstrainedManipulator(IConstrainedXRBodyManipulator)
    OnUnlinkedFromBody()

    OnUnlinkedFromBody()

    Called when a body unlinks this manipulator from it. The implementation should ensure that linkedBody returns null after this method is called.

    Declaration
    void OnUnlinkedFromBody()
    See Also
    UnlinkConstrainedManipulator()
    OnLinkedToBody(XRMovableBody)

    See Also

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