Class DeviceBasedSnapTurnProvider
A locomotion provider that allows the user to rotate their rig using a specified 2D axis input. The provider can take input from multiple different devices (such as Left and Right hands).
Inheritance
DeviceBasedSnapTurnProvider
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Snap Turn Provider (Device-based)", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/api/UnityEngine.XR.Interaction.Toolkit.DeviceBasedSnapTurnProvider.html")]
public class DeviceBasedSnapTurnProvider : SnapTurnProviderBase
Properties
controllers
The XRControllers that allow SnapTurn. An XRController must be enabled in order to Snap Turn.
Declaration
public List<XRBaseController> controllers { get; set; }
Property Value
Type | Description |
---|---|
List<XRBaseController> |
deadZone
The deadzone that the controller movement will have to be above to trigger a snap turn.
Declaration
public float deadZone { get; set; }
Property Value
Type | Description |
---|---|
float |
turnUsage
The 2D Input Axis on the controller devices that will be used to trigger a snap turn.
Declaration
public DeviceBasedSnapTurnProvider.InputAxes turnUsage { get; set; }
Property Value
Type | Description |
---|---|
DeviceBasedSnapTurnProvider.InputAxes |
Methods
ReadInput()
Reads the current value of the snap turn input.
Declaration
protected override Vector2 ReadInput()
Returns
Type | Description |
---|---|
Vector2 | Returns the input vector, such as from a thumbstick. |