![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | sassanh |
Is there a reliable way to load autoload scripts inside the editor?
I’m trying to have my game running in the editor, I was able to activate the physics engine and by adding @tool on top of my scripts meshes are generated and everything works. The problem is “sometimes” autoloads load and “sometimes” they don’t. So for example I add a new variable to an autoload script, when I try to read it in other scripts I get “Invalid get index”, then I close Godot and reopen it and close scene and reopen it and delete autoload and add it again and after doing all these several times it suddenly starts to work. Then I add another variable and I do the above several times but this time it doesn’t work and the first one stops working too, then I rename the variable and after half an hour it starts to work.
My observation is that when it starts working, it doesn’t stop working until I add/rename a variable.
Is there an official clean way to load autoload scripts in the editor in a way that I can access them with their name instead of get_node
ing them?