Skip to main content
File: Assets/_MolcaSDK/_VR/Scripts/Scenario/Steps/ValveStep.cs
Base: Step

Role

Wires to a Valve interaction via SceneObjectReference (or equivalent serialized reference pattern in your version). Completes when rotation reaches the configured target angle; optional lock management and feedback UI references. Analog feedback UI may pair with valve training UI helpers.

Code

On activate, resolve valveInteractionRefValveInteraction.SubscribeToAngle(targetAngle, OnTargetAngleReached); callback calls Complete(). Optional AnalogFeedbackUI from feedbackUIRef; autoManageLock unlocks on activate and re-locks on deactivate/complete.
// Runtime retarget (while step is active):
using MolcaSDK.VR.Scenario;

public class ValveLessonConfig : UnityEngine.MonoBehaviour
{
    public ValveStep step;

    public void UseAngle(float degrees) => step.SetTargetAngle(degrees);
}

Troubleshooting

  • No completion / null interaction error — Ensure SceneObjectReference points at the object with Valve interaction; wait for async ResolveAsync (errors log after activation).
  • Target angle never hitValve interaction min/max clamp, locked state, or wrong targetAngle vs handle rotation range.
  • Feedback UI stuck — Assign feedbackUIRef or leave invalid to skip; AnalogFeedbackUI must implement Setup() / Show() as in SDK.

Unity Editor

ValveStep + SceneObjectReference to ValveInteraction.

ValveStep in Unity Inspector