Class ContinuousMoveProvider
Locomotion provider that allows the user to smoothly move their rig continuously over time based on read input values, such as from the controller thumbstick.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Locomotion.Movement
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Continuous Move Provider", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement.ContinuousMoveProvider.html")]
public class ContinuousMoveProvider : LocomotionProvider, IGravityController
Properties
canProcess
Whether the gravity can be processed.
Gravity controllers that can process receive queries to gravity
Declaration
public bool canProcess { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It's recommended to return is
See Also
enableFly
Controls whether to enable flying (unconstrained movement). This overrides the use of gravity.
Declaration
public bool enableFly { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
enableStrafe
Controls whether to enable strafing (sideways movement).
Declaration
public bool enableStrafe { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
forwardSource
The source Transform that defines the forward direction.
Declaration
public Transform forwardSource { get; set; }
Property Value
Type | Description |
---|---|
Transform |
See Also
gravityPaused
Whether gravity is paused.
Declaration
public bool gravityPaused { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
inAirControlModifier
Determines how much control the player has while in the air (0 = no control, 1 = full control).
Declaration
public float inAirControlModifier { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
leftHandMoveInput
Reads input data from the left hand controller. Input Action must be a Value action type (Vector 2).
Declaration
public XRInputValueReader<Vector2> leftHandMoveInput { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
moveSpeed
The speed, in units per second, to move forward.
Declaration
public float moveSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
rightHandMoveInput
Reads input data from the right hand controller. Input Action must be a Value action type (Vector 2).
Declaration
public XRInputValueReader<Vector2> rightHandMoveInput { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
transformation
The transformation that is used by this component to apply translation movement.
Declaration
public XROriginMovement transformation { get; set; }
Property Value
Type | Description |
---|---|
XROrigin |
See Also
Methods
Awake()
See Mono
Declaration
protected override void Awake()
Overrides
See Also
ComputeDesiredMove(Vector2)
Determines how much to slide the rig due to input
vector.
Declaration
protected virtual Vector3 ComputeDesiredMove(Vector2 input)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | input | Input vector, such as from a thumbstick. |
Returns
Type | Description |
---|---|
Vector3 | Returns the translation amount in world space to move the rig. |
See Also
MoveRig(Vector3)
Creates a locomotion event to move the rig by translationInWorldSpace
,
and optionally applies gravity.
Declaration
protected virtual void MoveRig(Vector3 translationInWorldSpace)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | translationInWorldSpace | The translation amount in world space to move the rig (pre-gravity). |
See Also
OnDisable()
See Mono
Declaration
protected void OnDisable()
See Also
OnEnable()
See Mono
Declaration
protected void OnEnable()
See Also
OnGravityLockChanged(GravityOverride)
Called from Try
Declaration
protected virtual void OnGravityLockChanged(GravityOverride gravityOverride)
Parameters
Type | Name | Description |
---|---|---|
Gravity |
gravityOverride | The Gravity |
See Also
OnGroundedChanged(bool)
Called from Gravity
Declaration
protected virtual void OnGroundedChanged(bool isGrounded)
Parameters
Type | Name | Description |
---|---|---|
bool | isGrounded | Whether the player is on the ground. |
See Also
OnLocomotionEnding()
Called when locomotion enters the Ended state, after the provider invokes
locomotion
Declaration
protected override void OnLocomotionEnding()
Overrides
See Also
OnLocomotionStarting()
Called when locomotion enters the Moving state, after the provider gains
access to the XRBody
Declaration
protected override void OnLocomotionStarting()
Overrides
See Also
RemoveGravityLock()
Removes this provider from the Gravity
Declaration
public void RemoveGravityLock()
See Also
TryLockGravity(GravityOverride)
Attempts to lock gravity.
Declaration
public bool TryLockGravity(GravityOverride gravityOverride)
Parameters
Type | Name | Description |
---|---|---|
Gravity |
gravityOverride | The Gravity |
Returns
Type | Description |
---|---|
bool | Whether the gravity was successfully locked. |
See Also
Update()
See Mono
Declaration
protected void Update()