> ## 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.

# EnvironmentChangeStep

> Triggers or waits on environment / scene variant swaps.

**File:** `Assets/_MolcaSDK/_VR/Scripts/Scenario/Steps/EnvironmentChangeStep.cs`\
**Base:** [Step](/core/step)

## When to use

Use `Environment Change Step` when a VR training scenario needs this specific interaction as a step in a sequence. Configure entirely in the Inspector — no code required.

## Role

Listens to **`EnvironmentHelper.onEnvironmentChanged`**. When the reported **index** equals **`environmentIndex`**, calls **`Complete()`**. **`FindFirstObjectByType<EnvironmentHelper>()`** is used on activate/deactivate — exactly one active helper should exist.

## Code

```csharp theme={null}
// Raise from your environment switcher:
// environmentHelper.onEnvironmentChanged.Invoke(newIndex);

using MolcaSDK.VR.Scenario;

// Serialized environmentIndex on EnvironmentChangeStep must match emitted index.
```

## Troubleshooting

* **Never completes** — No **`EnvironmentHelper`** in scene, event never fires, or index mismatch vs **`environmentIndex`**.
* **Wrong environment completes step** — Align **`environmentIndex`** with the helper’s indexing (0-based vs 1-based).
* **Multiple helpers** — `FindFirstObjectByType` binds arbitrarily; keep a single helper or replace with an injected reference in a fork.

## Related

* [Step (base class)](/core/step)
* Search **`EnvironmentHelper`** in SDK for API

## Unity Editor

<Frame hint="EnvironmentChangeStep with target environment references." caption="EnvironmentChangeStep Inspector">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/ptmolcateknologinusantara/images/features/vr/steps/environment-change-step-inspector.png" alt="EnvironmentChangeStep in Unity Inspector" />
</Frame>
