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.2/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 gravityPaused, controllers that cannot process do not.
Declaration
public bool canProcess { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.
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 |
---|---|
XRInputValueReader<Vector2> |
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 |
---|---|
XRInputValueReader<Vector2> |
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 |
---|---|
XROriginMovement |
See Also
Methods
Awake()
See MonoBehaviour.
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 MonoBehaviour.
Declaration
protected void OnDisable()
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()
See Also
OnGravityLockChanged(GravityOverride)
Called from TryLockGravity(IGravityController, GravityOverride) when gravity lock is changed.
Declaration
protected virtual void OnGravityLockChanged(GravityOverride gravityOverride)
Parameters
Type | Name | Description |
---|---|---|
GravityOverride | gravityOverride | The GravityOverride to apply. |
See Also
OnGroundedChanged(bool)
Called from GravityProvider when the grounded state changes.
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 locomotionEnded and before it loses access to the XRBodyTransformer.
Declaration
protected override void OnLocomotionEnding()
Overrides
See Also
OnLocomotionStarting()
Called when locomotion enters the Moving state, after the provider gains access to the XRBodyTransformer and before it invokes locomotionStarted.
Declaration
protected override void OnLocomotionStarting()
Overrides
See Also
OnLocomotionStateChanging(LocomotionState)
Called when the locomotion state changes before it invokes locomotionStateChanged.
Declaration
protected override void OnLocomotionStateChanging(LocomotionState state)
Parameters
Type | Name | Description |
---|---|---|
LocomotionState | state | The locomotion state this provider is changing to. |
Overrides
See Also
RemoveGravityLock()
Removes this provider from the GravityProvider list's of locked providers.
Declaration
public void RemoveGravityLock()
See Also
TryLockGravity(GravityOverride)
Attempts to lock gravity.
Declaration
public bool TryLockGravity(GravityOverride gravityOverride)
Parameters
Type | Name | Description |
---|---|---|
GravityOverride | gravityOverride | The GravityOverride to apply. |
Returns
Type | Description |
---|---|
bool | Whether the gravity was successfully locked. |
See Also
Update()
See MonoBehaviour.
Declaration
protected void Update()