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

# BranchingStep

> Selects one of multiple child branch steps at runtime.

**Namespace:** `Molca.Sequence`\
**File:** `Packages/com.molca.core/Runtime/Sequence/Step/BranchingStep.cs`

## Role

`BranchingStep` allows a sequence to take different paths based on runtime decisions. It holds an array of child `Step` objects (`branchSteps[]`). Call `SetBranch(index)` to activate exactly one branch and disable all others.

## Inspector

* **`branchDescription`** — text describing the branch options.
* **`branchSteps`** — array of child `Step` references. Exactly one will be activated when a branch is chosen.

## Code

```csharp theme={null}
using Molca.Sequence;

public class BranchController : MonoBehaviour
{
    [SerializeField] private BranchingStep branchingStep;

    public void ChooseBranch(int index)
    {
        branchingStep.SetBranch(index);
    }
}
```

`SetBranch(index)` validates the index and enables only the chosen branch step, disabling all others. The `BranchingStep` then completes.

## Related

* [Step (base class)](/core/step)
* [ConditionalStep](/vr/steps/conditional-step) — binary true/false branching
* [Core step types](/core/core-step-types)
