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
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/Locomotion/Snap Turn Provider (Device-based)", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/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 |
---|---|
Single |
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. |