MolcaSDK.VRFile:
Assets/_MolcaSDK/_VR/Scripts/VRPlayerManager.cs
Attach to the XR Origin (XR Rig) root. Uses a static Instance; resolves VRSubsystem after RuntimeManager initialization.
When to use
UseVRPlayerManager when you need a single place to:
- Read player ground position (
GetGroundPosition— head XZ with XR Origin Y). - Enable or disable all XR Interaction Toolkit locomotion providers together (teleport, move, snap turn, etc.), e.g. during precision Grab step work.
- Access left/right
VRControllerVisualfrom static properties for haptics or visuals.
Inspector setup
After
WaitForInitialization, the manager caches providers and sets IsLocomotionEnabled from the first provider’s enabled state (or false if none).
Code
Disable locomotion for a precision step, then restore:EventConstants.VR.LocomotionStateChanged via EventDispatcher if other systems need to react (payload type LocomotionStateChangedData, property IsEnabled).
API (key members)
Troubleshooting
- “Instance not found” / null static access — Only one
VRPlayerManagershould exist on the active rig;AwakeassignsInstance. Ensure the rig is active before calling static helpers from arbitrary objects. - Locomotion toggle does nothing — Confirm
LocomotionProvidercomponents live under the same GameObject hierarchy (auto-discover) or are assigned in manual list. Check the Console for “No locomotion providers” warnings. VRSubsystem not found— RuntimeManager prefab must includeVRSubsystem; wait until after subsystem init (manager waits inStart).- Wrong ground height —
GetGroundPositionusesxROrigin.transform.position.y; verify XROrigin reference and floor / tracking setup.
Related
- Scenario activity — broader scenario / VR flow
- RuntimeManager — initialization and
GetSubsystem - Grab step — typical reason to disable locomotion
- EventDispatcher — locomotion state events
Unity Editor
XR Origin root with VRPlayerManager + locomotion components.

VRPlayerManager on XR Origin