> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# VR session flow (how-to)

> Practical checklist for auth, session creation, scene load, and event wiring in molca-sdk-vr.

**Product:** [Molca VR SDK](/overview/platforms)\
**Primary script:** `Assets/_MolcaSDK/_VR/Scripts/Scenario/Session/ScenarioSessionManager.cs`

## Goal

Run one complete backend session flow:

1. Wait runtime initialization
2. Create session
3. Load/start scenario
4. Observe progress/error events
5. Enter playable scenario scene

## Prerequisites

* [Scenario Data Config](/setup/scenario-data-config) contains the target scenario collection.
* [Scenario network config](/vr/scenario-network-config) is valid for the environment.
* A [RuntimeManager](/core/runtime-manager) prefab includes `ScenarioSessionManager`.

## Implementation checklist

```csharp theme={null}
using Molca;
using MolcaSDK.VR.Scenario.Session;
using UnityEngine;

public class SessionBootstrap : MonoBehaviour
{
    private ScenarioSessionManager _session;

    private async void Start()
    {
        await RuntimeManager.WaitForInitialization();
        _session = RuntimeManager.GetSubsystem<ScenarioSessionManager>();
        if (_session == null) return;

        // Subscribe early for diagnostics
        _session.OnError.AddListener(OnError);
        _session.OnLoadingProgress.AddListener(OnProgress);

        var created = await _session.CreateSessionAsync(orgScenarioId: 42, mode: "TRAINING");
        if (!created) return;

        // Pick one per UX:
        // await _session.LoadSessionWithModalAsync(...);
        // await _session.LoadSessionWithProgressAsync(...);
    }

    private void OnDestroy()
    {
        if (_session == null) return;
        _session.OnError.RemoveListener(OnError);
        _session.OnLoadingProgress.RemoveListener(OnProgress);
    }

    private void OnError(string msg) => Debug.LogError(msg);
    private void OnProgress(float value, string status) => Debug.Log($"Load {value:P0} - {status}");
}
```

## Troubleshooting quick checks

* **Create session fails:** verify token/auth stage and org scenario id.
* **Progress never moves:** confirm scenario scene/addressable keys and content package availability.
* **Scene loads but training doesn't start:** verify [Scenario manager](/vr/scenario-manager) scene wiring and data config linkage.

## Related

* [Recipe: Set up a VR scenario](/recipes/setup-vr-scenario) — step-by-step guide for creating a complete VR training scenario
* [Session loading and events](/vr/session-loading-and-events)
* [Scenario network config](/vr/scenario-network-config)
* [Troubleshooting](/overview/troubleshooting)
