Class StepMoveProvider
Locomotion provider that allows the user to move their rig in fixed distance steps based on read input values, such as from hand microgesture swipes or the controller thumbstick.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Step Move Provider", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@7.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement.StepMoveProvider.html")]
public class StepMoveProvider : LocomotionProvider
Properties
canStartMoving
Whether the provider has finished preparing for locomotion and is ready to enter the Moving state. This only applies when locomotionState is Preparing, so there is no need for this implementation to query locomotionState.
Declaration
public override bool canStartMoving { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
See Also
debounceTime
The amount of time that Unity waits before starting another step.
Declaration
public float debounceTime { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
See Also
delayTime
The time (in seconds) to delay the first step after receiving initial input to start stepping. Subsequent steps while holding down input are delayed by the debounceTime, not the delay time. This delay can be used, for example, as time to set a tunneling vignette effect as a VR comfort option.
Declaration
public float delayTime { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
See Also
enableStepBackward
Controls whether to enable backward steps.
Declaration
public bool enableStepBackward { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
enableStrafe
Controls whether to enable left and right steps.
Declaration
public bool enableStrafe { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
forwardSource
The source Transform that defines the forward direction. If not set, Unity uses the camera of the XR Origin.
Declaration
public Transform forwardSource { get; set; }
Property Value
| Type | Description |
|---|---|
| Transform |
See Also
leftHandStepInput
Reads input data from the left hand. Input Action must be a Value action type (Vector 2).
Declaration
public XRInputValueReader<Vector2> leftHandStepInput { get; set; }
Property Value
| Type | Description |
|---|---|
| XRInputValueReader<Vector2> |
See Also
rightHandStepInput
Reads input data from the right hand. Input Action must be a Value action type (Vector 2).
Declaration
public XRInputValueReader<Vector2> rightHandStepInput { get; set; }
Property Value
| Type | Description |
|---|---|
| XRInputValueReader<Vector2> |
See Also
stepDistance
The distance (in meters) Unity moves the rig with each step.
Declaration
public float stepDistance { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
See Also
transformation
The transformation that is used by this component to apply step movement.
Declaration
public XROriginMovement transformation { get; set; }
Property Value
| Type | Description |
|---|---|
| XROriginMovement |
See Also
Methods
ComputeStepMotion(Vector2)
Determines the translation in world space for a single step.
Declaration
protected virtual Vector3 ComputeStepMotion(Vector2 direction)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | direction | The step direction in rig space, where |
Returns
| Type | Description |
|---|---|
| Vector3 | Returns the translation amount in world space to move the rig. |
See Also
GetStepDirection(Vector2)
Determines the direction of the step based on the input vector.
Declaration
protected virtual Vector2 GetStepDirection(Vector2 input)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | input | Input vector, such as from a thumbstick. |
Returns
| Type | Description |
|---|---|
| Vector2 | Returns the step direction in rig space, where |
See Also
OnDisable()
See MonoBehaviour.
Declaration
protected override void OnDisable()
Overrides
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected override void OnEnable()
Overrides
See Also
Update()
See MonoBehaviour.
Declaration
protected void Update()