Can we have functions with the same name in different scripts? (GDScript)

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

If in two different scripts we define two functions with the same name, we are caught with a “misplaced func” error, even if we define the two scripts as classes. Is it possible to have different scripts with functions sharing the same name?

:bust_in_silhouette: Reply From: kidscancode

Yes, you can have functions with the same name.

“misplaced func” isn’t an error because of the name, it means you wrote func where it doesn’t belong.

Identation error. Still getting used to python x)

paternostrox | 2021-06-20 23:12

No problem. But remember, GDScript is not Python.

kidscancode | 2021-06-21 00:18