Why don't GDScript functions require to be defined? You can simply call them and they execute regardless of where they are in the script. Do you know why that is? Alternatively, in python, functions need to be defined (def) at the beginning of your code before they can be called.

Thanks

I am new to Godot, but have a lot of programing experience so anyone that knows better please feel free to correct me.

But I think the answer is that gdscript is not python.

For example, in python you can call a method from the "module" or "script" itself, but in gdscript it is not possible.

For example one can not do this:

This means that all methods have to be called from an ready or process method etc. And those are called after the whole script is loaded and thus all methods already exists.

Thanks Cflow. That makes sense now

3 years later