Class GrabMoveProvider
Locomotion provider that allows the user to move as if grabbing the whole world around them. When the controller moves, the XR Origin counter-moves in order to keep the controller fixed relative to the world.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Grab Move Provider", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement.GrabMoveProvider.html")]
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public class GrabMoveProvider : ConstrainedMoveProvider
Properties
canMove
Controls whether this provider can move the XR Origin.
Declaration
public bool canMove { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
controllerTransform
The controller Transform that will drive grab movement with its local position. Will use this GameObject's Transform if not set.
Declaration
public Transform controllerTransform { get; set; }
Property Value
Type | Description |
---|---|
Transform |
See Also
enableMoveWhileSelecting
Controls whether to allow grab move locomotion while the controller is selecting an interactable.
Declaration
public bool enableMoveWhileSelecting { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
grabMoveInput
Input data that will be used to perform grab movement while held. If the source is an Input Action, it must have a button-like interaction where phase equals performed when pressed. Typically a UnityEngine.InputSystem.Controls.ButtonControl Control or a Value type action with a Press interaction.
Declaration
public XRInputButtonReader grabMoveInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputButtonReader |
See Also
moveFactor
The ratio of actual movement distance to controller movement distance.
Declaration
public float moveFactor { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
See Also
ComputeDesiredMove(out bool)
Determines how much to move the rig.
Declaration
protected override Vector3 ComputeDesiredMove(out bool attemptingMove)
Parameters
Type | Name | Description |
---|---|---|
bool | attemptingMove | Whether the provider is attempting to move. |
Returns
Type | Description |
---|---|
Vector3 | Returns the translation amount in world space to move the rig. |
Overrides
See Also
IsGrabbing()
Determines whether grab move is active.
Declaration
public bool IsGrabbing()
Returns
Type | Description |
---|---|
bool | Whether grab move is active. |
See Also
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()