- Edited
SuperGibaLogan You need to put tabs instead of spaces for all block indentations as you did in move_ghost
function. The script editor will display tabs as those subtle arrow thingies:
You can see it in the tutorial as well, that's how you know the instructor (or you) inserted a tab character there by pressing the tab key, not space. The number of tabs at the start of each line determines to which code block the line belongs. In GDScript similar to Python this indentation is used to structure the code. The structure affects the execution flow so take care not to mess it up there. One wrong tab and the code may not be working as intended.