docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CharacterControllerBodyManipulator

    Scriptable object that can perform constrained movement of an XRMovableBody by using a CharacterController that follows the user's body. Each time this object is about to call Move(Vector3) on the characterController, it first ensures that the center and height are set such that the bottom of the capsule matches the position determined by GetBodyGroundLocalPosition() and the height of the capsule matches Unity.XR.CoreUtils.XROrigin.CameraInOriginSpaceHeight.

    Inheritance
    object
    Object
    ScriptableObject
    ScriptableConstrainedBodyManipulator
    CharacterControllerBodyManipulator
    Implements
    IConstrainedXRBodyManipulator
    Inherited Members
    ScriptableConstrainedBodyManipulator.linkedBody
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    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
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [CreateAssetMenu(fileName = "CharacterControllerBodyManipulator", menuName = "XR/Locomotion/Character Controller Body Manipulator")]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.2/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.CharacterControllerBodyManipulator.html")]
    public class CharacterControllerBodyManipulator : ScriptableConstrainedBodyManipulator, IConstrainedXRBodyManipulator

    Properties

    characterController

    The character controller attached to the originTransform of the linkedBody. This is null if linkedBody is null.

    Declaration
    public CharacterController characterController { get; }
    Property Value
    Type Description
    CharacterController

    isGrounded

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

    Declaration
    public override bool isGrounded { get; }
    Property Value
    Type Description
    bool
    Overrides
    ScriptableConstrainedBodyManipulator.isGrounded

    lastCollisionFlags

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

    Declaration
    public override CollisionFlags lastCollisionFlags { get; }
    Property Value
    Type Description
    CollisionFlags
    Overrides
    ScriptableConstrainedBodyManipulator.lastCollisionFlags

    Methods

    MoveBody(Vector3)

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

    Declaration
    public override 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.

    Overrides
    ScriptableConstrainedBodyManipulator.MoveBody(Vector3)

    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
    public override void OnLinkedToBody(XRMovableBody body)
    Parameters
    Type Name Description
    XRMovableBody body

    The body linked with this manipulator.

    Overrides
    ScriptableConstrainedBodyManipulator.OnLinkedToBody(XRMovableBody)
    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
    public override void OnUnlinkedFromBody()
    Overrides
    ScriptableConstrainedBodyManipulator.OnUnlinkedFromBody()
    See Also
    UnlinkConstrainedManipulator()
    OnLinkedToBody(XRMovableBody)

    Implements

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