Class LocomotionSystem
The LocomotionSystem object is used to control access to the XR Rig. This system enforces that only one Locomotion Provider can move the XR Rig at one time. This is the only place that access to an XR Rig is controlled, having multiple instances of a LocomotionSystem drive a single XR Rig is not recommended.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public class LocomotionSystem : MonoBehaviour
Properties
busy
(Read Only) Whether a locomotion request is already being performed.
Declaration
public bool busy { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Busy
Declaration
[Obsolete("Busy has been deprecated. Use busy instead. (UnityUpgradable) -> busy")]
public bool Busy { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
timeout
The timeout (in seconds) for exclusive access to the XR Rig.
Declaration
public float timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
xrRig
The XR Rig object to provide access control to.
Declaration
public XRRig xrRig { get; set; }
Property Value
| Type | Description |
|---|---|
| XRRig |
Methods
Awake()
Declaration
protected void Awake()
FinishExclusiveOperation(LocomotionProvider)
Informs the LocomotionSystem that exclusive access to the XR Rig is no longer required.
Declaration
public RequestResult FinishExclusiveOperation(LocomotionProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| LocomotionProvider | provider | The locomotion provider that is relinquishing access. |
Returns
| Type | Description |
|---|---|
| RequestResult | Returns a RequestResult that reflects the status of the request. |
RequestExclusiveOperation(LocomotionProvider)
Attempt to "lock" access to the XR Rig for the provider.
Declaration
public RequestResult RequestExclusiveOperation(LocomotionProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| LocomotionProvider | provider | The locomotion provider that is requesting access. |
Returns
| Type | Description |
|---|---|
| RequestResult | Returns a RequestResult that reflects the status of the request. |
Update()
Declaration
protected void Update()