Assets/_MolcaSDK/_VR/Scripts/Scenario/Steps/LookAtStep.csBase: Step
Role
Tracks head/camera forward vs target direction; accumulates dwell time inside a configurable cone; optional reset when look leaves the cone. May bind to ProgressFeedbackUI.Code
Update (when active) tests gaze vs target with IsLookingAtTarget; accumulates requiredLookTime inside lookAngleThresholdDegrees. When reached, calls Complete(). resetProgressWhenLookAway clears dwell when the cone is lost.
Optional ProgressFeedbackUI from feedbackUIRef; target/head use SceneObjectReference → ReferenceableComponent transforms (head defaults to Camera.main if unset).
Troubleshooting
- No target / no head — Logs error if
lookAtTargetRefinvalid orCamera.mainmissing when head reference unset. - Dwell never fills — Widen cone angle, move target closer, or check wrong
ReferenceableComponenton the target object. - Progress resets unexpectedly — Disable
resetProgressWhenLookAwayfor “sticky” progress.
Related
Unity Editor
LookAtStep with target ref and threshold fields visible.
