CompiledFrog

Post #24: The GDScript While Loop

GDScript supports two main types of loops, a while and a for. Today we'll be looking into the while loop. See the code below:

screenshot

This is not the cleanest, but it's meant to show three main things:

  1. What the GDScript 'while' loop looks like
  2. continue - loop execution moves to the next iteration
  3. break - the loop breaks execution

Here is the output:

1
3
5
7
9