Class SnapTurnProviderBase
A locomotion provider that allows the user to rotate their rig using a 2D axis input.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class SnapTurnProviderBase : LocomotionProvider
Properties
debounceTime
The amount of time that Unity waits before starting another snap turn.
Declaration
public float debounceTime { get; set; }
Property Value
Type | Description |
---|---|
float |
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.
Declaration
public float delayTime { get; set; }
Property Value
Type | Description |
---|---|
float |
enableTurnAround
Controls whether to enable 180° snap turns.
Declaration
public bool enableTurnAround { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
enableTurnLeftRight
Controls whether to enable left and right snap turns.
Declaration
public bool enableTurnLeftRight { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
turnAmount
The number of degrees clockwise Unity rotates the rig when snap turning clockwise.
Declaration
public float turnAmount { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
GetTurnAmount(Vector2)
Determines the turn amount in degrees for the given input
vector.
Declaration
protected virtual float GetTurnAmount(Vector2 input)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | input | Input vector, such as from a thumbstick. |
Returns
Type | Description |
---|---|
float | Returns the turn amount in degrees for the given |
ReadInput()
Reads the current value of the snap turn input.
Declaration
protected abstract Vector2 ReadInput()
Returns
Type | Description |
---|---|
Vector2 | Returns the input vector, such as from a thumbstick. |
StartTurn(float)
Begins turning locomotion.
Declaration
protected void StartTurn(float amount)
Parameters
Type | Name | Description |
---|---|---|
float | amount | Amount to turn. |
Update()
See MonoBehaviour.
Declaration
protected void Update()