Assets/_MolcaSDK/_VR/Scripts/Base/MolcaInteractionBase.cs
Role
- Discovers
XRGrabInteractable - Tracks which interactor is active
- Lock / unlock interaction
- Implements analog interaction contracts used by valve/knob flows
Interactions/.
Code
Derive fromMolcaInteractionBase, let Awake auto-pick XRBaseInteractable on the same object (or assign interactable in the Inspector), and implement UpdateInteraction() for per-frame behavior while the user is interacting. The base registers with ReferenceManager after RuntimeManager is ready.
ValveInteraction / KnobInteraction for analog value plumbing.
Troubleshooting
- Interactable null — Assign
interactableor rely onAwake(sameGameObjectonly — no child search). - Reference / SceneObjectReference not found —
ReferenceManager.Registerruns afterWaitForInitialization; ensureReferenceManagerexists andrefIdis stable (OnValidategenerates ids). - Unexpected drops —
maxInteractionDistance> 0 forcesForceReleasewhen hand is too far; set 0 to disable. UpdateInteractionnot running — Only called whileisInteracting; verify XRIselectEntered/selectExitedwiring oninteractable.
Unity Editor
Valve or Knob prefab root showing MolcaInteractionBase-derived component + XRGrabInteractable.
