Class LocomotionSystem
The LocomotionSystem object is used to control access to the XR Origin. This system enforces that only one Locomotion Provider can move the XR Origin at one time. This is the only place that access to an XR Origin is controlled, having multiple instances of a LocomotionSystem drive a single XR Origin is not recommended.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Locomotion System", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.6/api/UnityEngine.XR.Interaction.Toolkit.LocomotionSystem.html")]
public class LocomotionSystem : MonoBehaviour
Properties
busy
(Read Only) If this value is true, the XR Origin's position should not be modified until this false.
Declaration
public bool busy { get; }
Property Value
| Type | Description |
|---|---|
| bool |
timeout
The timeout (in seconds) for exclusive access to the XR Origin.
Declaration
public float timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
xrOrigin
The XR Origin object to provide access control to.
Declaration
public XROrigin xrOrigin { get; set; }
Property Value
| Type | Description |
|---|---|
| XROrigin |
Methods
Awake()
See MonoBehaviour.
Declaration
protected void Awake()
FinishExclusiveOperation(LocomotionProvider)
Informs the LocomotionSystem that exclusive access to the XR Origin 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 Origin 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()
See MonoBehaviour.
Declaration
protected void Update()