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
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@2.5/api/UnityEngine.XR.Interaction.Toolkit.GrabMoveProvider.html")]
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
grabMoveAction
The Input System Action that Unity uses to perform grab movement while held. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionProperty grabMoveAction { get; set; }
Property Value
Type | Description |
---|---|
InputActionProperty |
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()