Autoload script isnt declared in current scope

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

The autoload is enabled. However it says the autoload script isnt declared in current scope.

:bust_in_silhouette: Reply From: Inces

This is the most bullshit unjustified error in Godot. I really hope they will finally fix it in Godot 4. This bug happens when project becomes complicated and Godot is running for longer than hour. Error will be triggered randomly 50% of the time when clicking to run the project. The only sollution is to reset editor and work on project for less than hour. Until it will occur again.

Turns out it can be fixed by making sure the Autoload inherits from the Node class instead of (e.g.) Resource or Object

Truly Godot 3 chicanery

gneurshk | 2022-10-07 16:48

Autoloads are added as nodes to the scene tree, so they must inherit from Node, not Resource or Object.

Calinou | 2022-10-07 16:49