Skip to main content
File: Assets/_MolcaSDK/_VR/Scripts/Interactions/KnobInteraction.cs
Base: MolcaInteractionBase

When to use

Use Knob 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

Inspector onRotationChanged, onPositionChanged, onFullRotation match the Valve interaction pattern:

Troubleshooting

  • Snaps feel wrong — Adjust snapPositions or disable snapToPositions for free rotation; startAngle must match your authored pose.
  • Same as valve: no grab — Confirm MolcaInteractionBase / XRGrabInteractable setup per MolcaInteractionBase.
  • Step does not complete — See KnobStep ( targetAngle vs snap indices).

Unity Editor

Knob prefab with KnobInteraction + snap positions array visible.

KnobInteraction in Unity Inspector

KnobInteraction Inspector