godotengine / godotengine/godot
Engine.get_singleton_list() does not include autoload scripts defined in the project settings.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.2.2.stable.custom_build [0cfe9491e]
### System information
Windows 10
### Issue description
[Autoload Scripts are also called Singletons in the docs](https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html) but I do not see them in `Engine.get_singleton_list()` thus I cannot get them with `Engine.get_singleton()` when I probably should be able to.
I only see the inbuilt singletons when I print the singleton list:
```
["Performance", "TextServerManager", "PhysicsServer2DManager", "PhysicsServer3DManager", "NavigationMeshGenerator", "ProjectSettings", "IP", "Geometry2D", "Geometry3D", "ResourceLoader", "ResourceSaver", "OS", "Engine", "ClassDB", "Marshalls", "TranslationServer", "Input", "InputMap", "EngineDebugger", "Time", "GDExtensionManager", "ResourceUID", "WorkerThreadPool", "ThemeDB", "JavaClassWrapper", "JavaScriptBridge", "DisplayServer", "RenderingServer", "AudioServer", "PhysicsServer2D", "PhysicsServer3D", "NavigationServer2D", "NavigationServer3D", "XRServer", "CameraServer"]
```
### Steps to reproduce
Create some Autoload Scripts in the project settings and see if they show up in `Engine.get_singleton_list()`.
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by reproducing the issue with an autoload configured in Project Settings, then inspect the entry points named in the report: Engine.get_singleton_list() and Engine.get_singleton(). Done means configured autoload scripts appear in the singleton list and can be retrieved through the singleton accessor, without removing the built-in entries.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100