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
Syntax
public abstract class SnapTurnProviderBase : LocomotionProvider
Properties
debounceTime
The amount of time that the system will wait before starting another snap turn.
Declaration
public float debounceTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
enableTurnAround
Controls whether to enable 180° snap turns.
Declaration
public bool enableTurnAround { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
enableTurnLeftRight
Controls whether to enable left and right snap turns.
Declaration
public bool enableTurnLeftRight { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
See Also
turnAmount
The number of degrees clockwise to rotate when snap turning clockwise.
Declaration
public float turnAmount { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
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 |
---|---|
Single | 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(Single)
Begins turning locomotion.
Declaration
protected void StartTurn(float amount)
Parameters
Type | Name | Description |
---|---|---|
Single | amount | Amount to turn. |
Update()
See
Declaration
protected void Update()