Skip to main content
Product: Molca VR SDK (paths assume molca-sdk-vr). Not used by the Digital Twin SDK (_MolcaDT). Script: Assets/_MolcaSDK/_VR/Scripts/Scenario/Data/ScenarioData.cs
Type: ScriptableObject (registered in Scenario Data Config collections)

When to use

Use ScenarioData (or its subclasses SimulationScenarioData / TourScenarioData) to define a VR training scenario:
  • Scenario metadata — name, description, image, tags, time limits
  • Activity definitions — ordered list of ScenarioActivityData entries
  • Scene loadingSceneLoadPlan for single-player and per-role multiplayer configurations
  • Launch options — execution mode support (Training/Assessment), config options
  • Multiplayer roles — role definitions and per-role scene plans
Each scenario asset is registered in Scenario Data Config collections and resolved at runtime by ScenarioSessionManager or Home UI.

Role

ScenarioData is the authoring asset that defines everything about a scenario:
  1. Metadata — displayed in Home UI, used for filtering/search
  2. ActivitiesScenarioActivityData entries matched to runtime ScenarioActivity components by RefId
  3. Scene loadingSceneLoadPlan structure executed by SceneLoadPlanExecutor to load ordered multi-scene setups
  4. Multiplayer — role definitions and per-role scene configurations
  5. Backend integrationScenarioId (org ID) links to backend scenario records
At runtime, Scenario Manager reads this asset to configure the scenario state machine, activity sequence, and scene loading.

Inspector setup

Basic metadata

Launch configuration

Activities

Roles (multiplayer only)

Scene loading

Single Player Plan

Role Scene Mappings (multiplayer only)

SceneLoadPlan structure

The SceneLoadPlan defines ordered multi-scene loading with synchronization:

Load order

  1. preloadScenes[0] loads as Single (becomes active scene)
  2. Wait for preloadScenes[0].waitForRefIds (or 2 frames if empty)
  3. preloadScenes[1..n] load as Additive (each waits for its RefIds)
  4. scenarioScene loads as Additive (when preloads exist) or Single (no preloads)

SceneEntry fields

Each scene entry has:

Code

Get scene load plan

Access metadata

Check for legacy data

Set organization scenario ID

Scene loading examples

Simple single scene

Environment + scenario (two scenes)

Addressable scenes

Multiplayer with role-specific scenes

API reference

Properties

Methods

Troubleshooting

  • Scenario not found at runtime: verify the asset is registered in Scenario Data Config collections. Check RefId matches the lookup key.
  • Scene doesn’t load: confirm scenarioScene has either sceneName or sceneReference set. For Addressables, verify the scene is marked as Addressable and the key is valid. Check SceneLoadPlan.IsValid.
  • Preload scenes load out of order: preload scenes load sequentially by array index. Index 0 always loads as Single (active scene); subsequent entries load Additive.
  • Scene loads but objects missing: check waitForRefIds on preload scenes. The executor waits up to 15 seconds for those RefIds to be registered in ReferenceManager. Check console for timeout warnings.
  • Multiplayer role scene not found: verify roleSceneMappings contains an entry with matching roleId. Check that the role’s SceneLoadPlan.IsValid.
  • Activities don’t match runtime components: ensure ScenarioActivity components in the scene have activityId matching ScenarioActivityData.RefId. Mismatches log warnings.
  • Legacy scene fields not migrating: call MigrateLegacySceneFields() in editor. Check that singlePlayerPlan is empty before migration (migration only runs when plan is invalid).
  • Time limit not enforced: verify TimeLimitSeconds > 0 and Scenario Manager is active. Time limit is checked in ScenarioManager.Update().

Unity Editor

Scenario Data Inspector

ScenarioData Inspector — metadata, activities, and scene loading configuration

Migration from legacy fields: If you have existing scenario assets created before the SceneLoadPlan refactoring, they contain hidden legacy fields (sceneName, singlePlayerSceneName, environmentSceneName, etc.). These are automatically migrated to singlePlayerPlan when accessed at runtime. For editor migration, call MigrateLegacySceneFields() in a custom editor script or inspector.
Addressable priority: When both sceneName and sceneReference are set on a SceneEntry, the Addressable reference takes priority. If the Addressable key is invalid, the scene load will fail — it does NOT fall back to sceneName. Set only one field to avoid confusion.