add_construction_script_for_loop
Add a For Loop node to a Blueprint's Construction Script to iterate over rows and instances, enabling procedural 2D grid generation in Unreal Editor.
Instructions
Add a For Loop node in a Blueprint's Construction Script.
From Ch. 19: Used in BP_ProceduralMeshes Construction Script to iterate over rows and instances. Nested For Loops create 2D grids of instances.
The Construction Script runs in the Editor when an instance is placed or its properties are changed, making it perfect for procedural generation.
Args: blueprint_name: Blueprint to add the node to first_index: Starting index (usually 1 for 1-based counting) last_index_variable: Variable providing the max loop count nested: Whether this is a nested (inner) loop node_position: [X, Y] graph position
KB: see knowledge_base/10_WORLD_BUILDING.md#overview Example: add_construction_script_for_loop(blueprint_name="/Game/MCP_Test/BP_Example")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nested | No | ||
| first_index | No | ||
| node_position | No | ||
| blueprint_name | Yes | ||
| last_index_variable | No | NumberOfRows |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |