Skip to main content
Product: Molca VR SDK (molca-sdk-vr). DT apps do not use this flow. This page is a linear checklist for a new simulation scenario. Tour scenarios follow the same data → scene → registry pattern; see the Tour section and Tour subsystem.

Prerequisites


1. Create simulation scenario data

  1. Project window → Create → MolcaSDK → Scenario → Simulation Scenario Data (or equivalent menu for SimulationScenarioData).
  2. Name the asset (e.g. Scenario_MyTraining).
  3. In the Inspector, set:
    • Ref Id — stable id (auto-generated if empty).
    • Scenario name / description / tags / image — Home UI and metadata (DynamicLocalization entries are initialized from RefId in BaseScenarioData.Initialize()).
    • Time limitTime Limit Seconds; 0 = no limit.
  4. Scenario Activities — add ScenarioActivityData entries (each has Ref Id, titles, Activity Id / slug fields as defined on the type). These are the authoring records the runtime ScenarioActivity will match.
  5. Scene loading — configure how this scenario loads:
    • Scene Reference on BaseScenarioData (Addressable) when used, or
    • On SimulationScenarioData: sceneName (SharedString), singlePlayerSceneName / singlePlayerSceneReference, and optionally roleSceneMappings for multiplayer splits.
Confirm the scene you build in the editor matches what this asset points at (name or Addressable key).

2. Create and lay out the scenario scene

  1. Create or open the Unity scene referenced by the scenario asset.
  2. Add the [VR Scenario] prefab (typical path: Assets/_MolcaSDK/_VR/Prefabs/Base/) — includes XR rig, scenario UI shell, and related objects (your project layout may vary).
  3. Select ScenarioManager on the prefab (or your scene root).

ScenarioManager (in scene)

FieldAction
Scenario DataAssign your SimulationScenarioData asset.
Auto StartEnable for immediate start on load; disable if you start from script.
ActivitiesAssign in step 3 (ordered list of ScenarioActivity components).
Start All Activities SimultaneouslyParallel vs first-only sequential behavior.
Is Direct Complete When All Activity CompleteAuto-finish scenario when every activity completes.
Use Session ManagerEnable for connected session flows.
Pause Modal / Pause InputWire pause UX.
See Scenario manager for state and timing notes.

3. Create activities in the scene

For each ScenarioActivityData on the asset:
  1. Create a GameObject (e.g. under an Activities parent).
  2. Add ScenarioActivity — Unity adds SequenceController automatically ([RequireComponent]).
  3. Set Activity Id on ScenarioActivity to the same string as that row’s ScenarioActivityData.RefId. At runtime, the component resolves ActivityData with FirstOrDefault(a => a.RefId == activityId); a mismatch logs a warning and breaks Home/session metadata binding.
  4. Configure autoAdvanceToNext if you want automatic progression to the next activity when the sequence completes.
  5. Drag each activity GameObject into ScenarioManager.Activities in the intended order (unless you rely entirely on simultaneous start — then order still matters for UI/progression).

4. Add steps under each activity

  1. Under each activity object, add child GameObjects and attach Step components (Grab, Valve, etc.).
  2. SequenceController discovers Step children and runs them in hierarchy order; use ParallelStep or bridges when you need non-linear flow.
  3. Wire SceneObjectReference / interactables: put ReferenceableComponent on targets and point steps at those Ref Ids.
  4. Optional: Auxiliaries on each step (scoring, haptics, controller hints — VR step auxiliaries).
Use Sequence Visualizer in the Unity Editor to inspect the tree, change step type, or open the CSV Step Importer.

5. Scoring (optional)

  1. ScenarioScoring on the ScenarioManager object (or as your prefab dictates).
  2. ActivityScoring per ScenarioActivity.
  3. StepScoringAuxiliary on steps that contribute points.
Details: ScoringConfig and related pages.

6. Register in ScenarioDataConfig

  1. Open the ScenarioDataConfig SettingModule.
  2. Under Scenario Collections, add or extend a collection.
  3. Add your SimulationScenarioData asset to the list so Home UI can list it (and so org/content flows can resolve it when connected).

7. Test

GoalSuggestion
Fast iterationDisable Use Session Manager on ScenarioManager, enter Play Mode from the scenario scene with Auto Start on.
Full flowRun Preload → Auth → Home, pick the scenario, and confirm session loading + scene name / Addressables match.

Tour variant (short path)

  1. Create TourScenarioData (Create → MolcaSDK → Scenario → Tour Scenario Data).
  2. Fill metadata, spots, materials, and scene reference like the simulation asset.
  3. Open the tour scene; use [VR Tour] from Assets/_MolcaSDK/_VR/Prefabs/Tour/ or [VR Scenario] with TourScenarioData assigned — mode driver selects tour behavior.
  4. Place TourAreaManager, TourSpotController, etc., per your content (Tour area and spots).
  5. Runtime prefab must include TourSubsystem when using tour + session flows.
  6. Register the asset in ScenarioDataConfig as above.

Unity Editor

Split: SimulationScenarioData Inspector + Hierarchy with ScenarioManager and Activities + one Step expanded.

Unity Editor showing scenario data and scene hierarchy