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
Syntax
[AddComponentMenu("XR/Locomotion/Grab Move Provider", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.3/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 |
---|---|
Boolean |
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 |
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 |
---|---|
Boolean |
grabMoveAction
The Input System Action that Unity uses to perform grab movement while held. Must be a ButtonControl Control.
Declaration
public InputActionProperty grabMoveAction { get; set; }
Property Value
Type | Description |
---|---|
InputActionProperty |
moveFactor
The ratio of actual movement distance to controller movement distance.
Declaration
public float moveFactor { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
ComputeDesiredMove(out Boolean)
Determines how much to move the rig.
Declaration
protected override Vector3 ComputeDesiredMove(out bool attemptingMove)
Parameters
Type | Name | Description |
---|---|---|
Boolean | attemptingMove | Whether the provider is attempting to move. |
Returns
Type | Description |
---|---|
Vector3 | Returns the translation amount in world space to move the rig. |
Overrides
IsGrabbing()
Determines whether grab move is active.
Declaration
public bool IsGrabbing()
Returns
Type | Description |
---|---|
Boolean | Whether grab move is active. |
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()