States and phases
A Hengo script is a state machine. At any moment the script is in exactly one state, and a state is a mode: waiting, walking, spinning, dead.
That is the difference from a plain script, where everything is one soup of ifs. Here, “walk toward
the point” simply does not exist outside the walking state, and you never have to guard it.
Read the frame you were given
Section titled “Read the frame you were given”Your script was born with one state, drawn as a frame: a titled band with a row of buttons, and a small graph inside it. The node in that graph is the state’s entry, carrying the state’s name and four cells.
Hovering each header button says what it does, and all of them are in The Canvas. Clicking the header band itself takes the canvas to that state.
The four cells
Section titled “The four cells”| Cell | When it runs |
|---|---|
| Start | once, the moment the state becomes active |
| Every Frame | every frame while it is active |
| Physics | every physics frame while it is active |
| End | once, on the way out |
Those four are the whole lifecycle of a state. Clicking a cell is how you put a step on it, which is the next page, and steps hang off it in the order the generated code runs them.
Which one to use:
- Start for setup that happens once: rolling a random number, picking a target, playing a sound.
- Every Frame for anything per frame: moving, easing, checking input.
- Physics for moving a physics body. Godot runs physics on a fixed tick, and moving a body from Every Frame gives you jitter.
- End for cleanup: putting a value back, stopping something you started. It runs even when the state is left in a hurry, which is what makes it the right place for undoing.
Name it
Section titled “Name it”Click the State settings button (the three dots) on the frame’s header, and set Name to
Playing. Right-clicking the state’s row under States in the Props tab opens the same popup.
That popup also holds Start, Can Reenter, a Description, and the branches a state can expose to whatever transitions into it. Exactly one state carries the Start flag, and that is where the machine begins.
Move around the canvas
Section titled “Move around the canvas”Drag empty canvas to pan and use the wheel to zoom, with the current zoom in the status bar. Double-click empty canvas to open the panel full screen.