Class ContinuousMoveProviderBase
Locomotion provider that allows the user to smoothly move their rig continuously over time.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public abstract class ContinuousMoveProviderBase : LocomotionProvider
Properties
enableFly
Controls whether to enable flying (unconstrained movement). This overrides useGravity.
Declaration
public bool enableFly { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
enableStrafe
Controls whether to enable strafing (sideways movement).
Declaration
public bool enableStrafe { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
forwardSource
The source Transform that defines the forward direction.
Declaration
public Transform forwardSource { get; set; }
Property Value
Type | Description |
---|---|
Transform |
gravityApplicationMode
Controls when gravity begins to take effect.
Declaration
public ContinuousMoveProviderBase.GravityApplicationMode gravityApplicationMode { get; set; }
Property Value
Type | Description |
---|---|
ContinuousMoveProviderBase.GravityApplicationMode |
See Also
moveSpeed
The speed, in units per second, to move forward.
Declaration
public float moveSpeed { get; set; }
Property Value
Type | Description |
---|---|
Single |
useGravity
Controls whether gravity affects this provider when a CharacterController is used. This only applies when enableFly is false.
Declaration
public bool useGravity { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
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. |
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). |
ReadInput()
Reads the current value of the move input.
Declaration
protected abstract Vector2 ReadInput()
Returns
Type | Description |
---|---|
Vector2 | Returns the input vector, such as from a thumbstick. |
Update()
See MonoBehaviour.
Declaration
protected void Update()