Class SnapTurnProvider
Locomotion provider that allows the user to rotate their rig in fixed angle increments based on read input values, such as from the controller thumbstick.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
Assembly: solution.dll
Syntax
[AddComponentMenu("XR/Locomotion/Snap Turn Provider", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.SnapTurnProvider.html")]
public class SnapTurnProvider : LocomotionProvider
Properties
| Name | Description |
|---|---|
| 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. |
| debounceTime | The amount of time that Unity waits before starting another snap turn. |
| delayTime | The time (in seconds) to delay the first turn after receiving initial input for the turn. Subsequent turns 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. |
| enableTurnAround | Controls whether to enable 180° snap turns. |
| enableTurnLeftRight | Controls whether to enable left and right snap turns. |
| leftHandTurnInput | Reads input data from the left hand controller. Input Action must be a Value action type (Vector 2). |
| rightHandTurnInput | Reads input data from the right hand controller. Input Action must be a Value action type (Vector 2). |
| transformation | The transformation that is used by this component to apply turn movement. |
| turnAmount | The number of degrees clockwise Unity rotates the rig when snap turning clockwise. |
Methods
| Name | Description |
|---|---|
| GetTurnAmount(Vector2) | Determines the turn amount in degrees for the given |
| OnDisable() | See MonoBehaviour. |
| OnEnable() | See MonoBehaviour. |
| StartTurn(float) | Begins turning locomotion. |
| Update() | See MonoBehaviour. |