Random Indentation Error On Y-Sorting System I'm trying to make

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sudevGD

enter image description here

any clue why it’s giving me this error? also, am I doing something wrong in the if statement? (sorry im relatively new to godot) SIDE NOTE: EVEN WHEN I DO PUT AN INDENTATION IT GIVES ME AN ERROR, SORRY I GAVE A BAD SCREENSHOT

edit: the second screenshot is the correct one

:bust_in_silhouette: Reply From: kidscancode

That is not random at all. An if statement is incomplete unless it has at least one line of code to be executed when the condition is true.

This is incomplete:

if x > 10:

This is not:

if x > 10:
    print("hello")

Hence exactly what the error message says: it expects to see an indented block after an if.