> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/delayed/immediate-actions.md).

# Immediate Actions

The `Delayed.Immediate` module executes actions instantly — it doesn’t wait for time, frames, or conditions (unless specified). It’s most useful for cases when you want to register actions in a unified “delayed” flow but still execute them right away — for example, when building chains or conditional executions.

***

### <mark style="color:$success;">Methods</mark>

<details>

<summary><strong>Do(Action callback)</strong></summary>

Executes the given `callback` immediately on the current frame.

```csharp
Delayed.Immediate.Do(() => Debug.Log("Executed immediately!"));
```

</details>

<details>

<summary><strong>If(Func condition, Action callback)</strong></summary>

Executes the `callback` immediately only if the provided `condition` returns `true`.

```csharp
Delayed.Immediate.If(() => playerHealth < 30 ,() => Debug.Log("Low health!"));
```

</details>

<details>

<summary><strong>WithChance(float probability, Action callback)</strong></summary>

Executes the `callback` immediately with a `probability` (0..1). Uses Unity’s `Random.value`.

```csharp
Delayed.Immediate.WithChance(0.25f, () => Debug.Log("25% chance executed!"));
```

</details>

***

### <mark style="color:$primary;">Notes</mark>

* Immediate actions can be repeated using the `Loop(int times)` method.
* Useful for chaining with `DelayedChain` or as part of conditional sequences.
