# Loop List with Node

Loops a Game Object List Variable and executes a State Machine Node for each value.

## Description

Iterates through a list of GameObjects and executes a specific node for each element. The **Target** argument of any instruction inside the node contains the current object being processed.

## Parameters

| Name              | Description                                                  |
| ----------------- | ------------------------------------------------------------ |
| **List Variable** | Local List or Global List whose elements are iterated        |
| **Node**          | The node to execute for each element in the list             |
| **Target**        | The target GameObject that contains the State Machine Runner |

## Keywords

`Iterate`, `Cycle`, `Every`, `All`, `Stack`

## Example

```
Actions Component:
└─ Loop List with Node
    ├─ List Variable: EnemiesInRange
    ├─ Node: "ApplyDamageNode"
    └─ Target: Self
```

This iterates through all enemies in the `EnemiesInRange` list and executes the "ApplyDamageNode" for each one.

{% hint style="success" %}
This is perfect for applying effects to multiple targets, such as:

* Area of effect damage
* Buff/debuff all allies
* Process all items in an inventory
  {% endhint %}

{% hint style="info" %}
Inside the executed node, use the **Target** reference to access the current element being processed.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ninjutsugames.com/game-creator-2/state-machine-2/visual-scripting/instructions/loop-list-with-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
