Godot 4.3
All of the sudden, singletons which have been working smoothly until now stopped working, and im panicking.
Now even tho the global scripts are configured correctly in the project setting im getting errors when running any scene:
E 0:00:31:0902 get_node_or_null: Can't use get_node() with absolute paths from outside the active scene tree.
<C++ Error> Condition "!data.inside_tree && p_path.is_absolute()" is true. Returning: nullptr
<C++ Source> scene/main/node.cpp:1727 @ get_node_or_null()
Line 1:Class "Ingredient" hides a global script class
I haven’t made any changes to the global script files im using, what is going on?
Can you show the ingredient script? and is the ingredient script an autoload?
Things i’ve tried:
Reverting commits to previous version.
Restarting the editor.
Restarting the machine.
I’ve managed to resolve this issue by removing the autoloaded scripts from the project setting, saving the project, and adding them back.
Are the projects cached in some way? Could it be that something was corrupted in the cache?
This is a bizarre and unexpected behavior. I’m just glad the project wasn’t trashed.
1 Like
Yes the cache is basically the “.godot”-folder.
if you managed to solve the problem then mark a solution
Sometimes I get this error when I add a .gd script file to my Autoloads instead of the .tscn file. I think another time I got this error because I added a class_name to my Autoload’s script when that’s not needed.
Yes a class_name with the same name as the autoload will throw an error
1 Like