Skip to reading
Visual Scripting in Depth

31. Repeat while a condition is true

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

Figure 22. While Loop compares the named variable every time the body returns.

1. Set pulse_count to 0.

2. Add While Loop. Choose pulse_count, operator <, and Value 3.

3. Connect TRUE to Change Variable: pulse_count add 1.

4. Add a short Wait if the effect should be visible over time.

5. Connect the last body node back to While Loop FLOW.

6. Connect FALSE to Return with {"$var":"pulse_count"}. The result should be 3.

A While Loop does not increment the variable for you. Its condition has to become false through something the body or another part of the game changes.

The current inline form includes Safety Limit, but the visual runner does not apply that field as an independent per-loop cap. Build a genuinely bounded condition. The runner’s shared 4096-step guard is the fallback, not the normal exit for your puzzle.

An endless loop can repeatedly award points, emit events or overwrite state before the shared guard stops it. Use a changing counter or a clear external completion condition, and check the FALSE exit.

Page 35 of 93Permalink
Go to page