Skip to content

FOR loop

69

The FOR loop node iterates through a numerical range from a minimum to a maximum value, triggering actions or calculations at each iteration. It is the primary engine for creating repeating logic, timed counters, and smooth procedural animations.

When to use this node: * Gradual Transitions: Driving a smooth fade-in or fade-out for lighting by using the position output to gradually increase intensity. * Timed Events: Utilizing the autoTick property to run logic at a fixed rate. In this mode, the loop progresses at 25 ticks per second (one tick every 40ms), allowing for precise timing based on the game engine's internal clock. * Scanning Logic: Iterating through a series of indices to check conditions across multiple sensors or data arrays. * Automated Animations: Creating "ping-pong" effects by enabling reverse direction or reverse on restart, causing a value to oscillate back and forth between two points.

Pro Tip: The position output is extremely versatile. Connect it to a MAP or Lerp node to translate the current loop iteration into complex physical movements or color shifts in real-time.

Connectors in

  • min [type: variant]
  • max [type: variant]
  • step [type: variant]
  • tick [type: action]
  • restart [type: action]
  • autoTick [type: bool]

Connectors out

  • position [type: variant]
  • onChange [type: action]
  • onFinish [type: action]
  • finished [type: bool]
  • running [type: bool]

Node properties

  • auto restart [type: bool]
  • auto tick [type: bool]
  • intervalInTicks [type: integer]
  • max [type: integer]
  • min [type: integer]
  • reverse direction [type: bool]
  • reverse on restart [type: bool]
  • step [type: integer]