Assets/_MolcaSDK/_VR/Scripts/Interactions/KnobInteraction.csBase: MolcaInteractionBase
When to use
UseKnob Interaction when a VR training scene needs a physical control the trainee manipulates. Works with the matching step type (e.g. Knob Interaction pairs with knob-interaction). Configure in Inspector.
Role
Tracks wrist rotation around the knob axis, applies smoothing and optional snap angles.Setup
Same pattern as Valve interaction:XRGrabInteractable + component + references for KnobStep.
Code
InspectoronRotationChanged, onPositionChanged, onFullRotation match the Valve interaction pattern:
Troubleshooting
- Snaps feel wrong — Adjust
snapPositionsor disablesnapToPositionsfor free rotation;startAnglemust match your authored pose. - Same as valve: no grab — Confirm
MolcaInteractionBase/XRGrabInteractablesetup per MolcaInteractionBase. - Step does not complete — See KnobStep (
targetAnglevs snap indices).
Unity Editor
Knob prefab with KnobInteraction + snap positions array visible.

KnobInteraction Inspector