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 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 CameraInOriginSpaceHeight.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
Assembly: solution.dll
Syntax
[CreateAssetMenu(fileName = "CharacterControllerBodyManipulator", menuName = "XR/Locomotion/Character Controller Body Manipulator")]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.CharacterControllerBodyManipulator.html")]
public class CharacterControllerBodyManipulator : ScriptableConstrainedBodyManipulator, IConstrainedXRBodyManipulator
Properties
| Name | Description |
|---|---|
| characterController | The character controller attached to the originTransform of the linkedBody. This is null if linkedBody is null. |
| isGrounded | Whether the linkedBody is touching the ground, as of the most recent call to MoveBody(Vector3). |
| lastCollisionFlags | Flags indicating the direction of the collision from the most recent call to MoveBody(Vector3). |
Methods
| Name | Description |
|---|---|
| MoveBody(Vector3) | Applies the given motion to linkedBody. A collision can constrain the movement from taking place. |
| OnLinkedToBody(XRMovableBody) | Called after the given body links this manipulator to it. The implementation should ensure that
linkedBody points to |
| OnUnlinkedFromBody() | Called when a body unlinks this manipulator from it. The implementation should ensure that linkedBody returns null after this method is called. |