Skip to main content
File: Assets/_MolcaSDK/_VR/Scripts/Scenario/Scoring/ScoringConfig.cs

Aggregation layers

ScoringConfig instances are used at step, activity, and scenario levels: See Step scoring auxiliary, Activity scoring, and Scenario scoring.

ScoringType reference

Enum values and behavior match ScoringConfig.CalculateScore(float timeTaken, float accuracy = 1f) in ScoringConfig.cs. After the switch, the result is multiplied by scoreMultiplier; if allowNegativeScore is false, the final score is clamped to ≥ 0. IsTimeBased() is true only for TimeBonus, TimePenalty, and Countdown (drives StepScoringAuxiliary OnStepUpdate refresh).

Shared tuning (all types except None)

GetMaxPossibleScore() (UI caps & normalization)

Implementation detail

Prefer calling CalculateScore / GetMaxPossibleScore on ScoringConfig rather than duplicating formulas in gameplay code. StepScoringAuxiliary sets accuracy for Binary / Accuracy via SetCorrect, SetIncorrect, SetAccuracy, SetAccuracyPercent before finalize — see Step scoring auxiliary.

When to use

Embed ScoringConfig (serialized class, not necessarily a standalone asset) wherever scoring is configured: StepScoringAuxiliary, ActivityScoring, ScenarioScoring. Choose None when the layer should not contribute numeric score but you still want a placeholder in the Inspector.

Troubleshooting

  • Scores always zeroType may be None; or time-based config has maxPoints / windows set so the formula yields 0 at current timeTaken / accuracy.
  • Binary feels inverted — Accuracy is 0–1: use StepScoringAuxiliary.SetCorrect / SetIncorrect (or SetResult(bool)) so CalculateScore treats correct as 0.5 and above and incorrect below 0.5.
  • Unexpected negatives — Enable allowNegativeScore or raise minPoints / adjust TimePenalty rate; final value is still multiplied by scoreMultiplier.

Unity Editor

Embedded ScoringConfig on StepScoringAuxiliary or standalone asset if you use ScriptableObject variants.

ScoringConfig in Unity Inspector

ScoringConfig fields