Quick answer: Add class_name to your autoload script so other scripts can reference the type directly. Alternatively, use get_node("/root/YourAutoloadName") for untyped access. Ensure the autoload is listed above any scripts that depend on it in Project Settings.
Here is how to fix Godot autoload not accessible from other scripts. You create a GameManager autoload, register it in Project Settings, and try to call GameManager.start_level() from your player script. The editor shows “Identifier not found” or the method call returns null at runtime. The autoload exists, it runs, but other scripts cannot see it. This comes down to how Godot resolves global names versus node paths.
The Symptom
You reference your autoload by name in another script and get a parser error: “Identifier ‘GameManager’ not declared in the current scope.” Or at runtime, calling methods on the autoload returns null or crashes with “Invalid call. Nonexistent function.”
Another variant: the autoload works in some scripts but not others. Scripts that load early can access it, scripts that load later cannot — or vice versa depending on how you reference it.
What Causes This
Missing class_name declaration. In Godot 4, autoload names registered in Project Settings are accessible via get_node("/root/Name") but are NOT automatically available as global type identifiers. You need class_name in the script for direct typed access.
Name mismatch between autoload and class_name. If your script has class_name GameMgr but the autoload is registered as “GameManager”, you access the singleton via GameManager (autoload name) through get_node, but type annotations use GameMgr (class_name). This confusion leads to errors.
Load order dependency. Autoloads initialize top-to-bottom. If your EventBus autoload references your DataStore autoload during _ready(), DataStore must be listed above EventBus in the autoload list.
Accessing autoload during _init. The _init() function runs before the node is added to the tree. Autoloads are tree nodes at /root/Name. Accessing them during _init() fails because the tree is not available yet.
The Fix
Step 1: Add class_name to your autoload script.
# game_manager.gd
class_name GameManager
extends Node
var current_level: int = 0
func start_level(level_id: int) -> void:
current_level = level_id
get_tree().change_scene_to_file("res://levels/level_%d.tscn" % level_id)
With class_name GameManager, the type is globally registered. Other scripts can use it in type annotations and the editor recognizes it.
Step 2: Access via get_node for untyped calls. If you cannot add class_name (name collision, external plugin), use the node path:
func _ready():
var gm = get_node("/root/GameManager")
gm.start_level(1)
This always works because autoloads are children of the scene tree root. The name matches whatever you entered in Project Settings > Autoload.
Step 3: Use typed access with class_name. For full autocomplete and type safety:
func _ready():
var gm: GameManager = get_node("/root/GameManager")
gm.start_level(1)
# Or use the direct global if class_name matches autoload name
func do_something():
GameManager.start_level(2)
When class_name matches the autoload name exactly, Godot allows direct access like GameManager.method() without get_node. This is the cleanest pattern.
Step 4: Fix load order. In Project Settings > Autoload, drag entries to reorder. Dependencies must be listed above dependents:
# Correct order in Project Settings:
# 1. DataStore (no dependencies)
# 2. EventBus (depends on DataStore)
# 3. GameManager (depends on EventBus and DataStore)
If GameManager calls EventBus.connect("game_started", ...) in its _ready(), EventBus must already exist. Reorder to fix.
Avoiding _init Traps
Never access other autoloads in _init(). Move all cross-autoload references to _ready():
class_name EventBus
extends Node
# Wrong: tree not available in _init
func _init():
var store = get_node("/root/DataStore") # null!
# Correct: tree is ready
func _ready():
var store = get_node("/root/DataStore") # works
store.connect("data_loaded", _on_data_loaded)
“Autoloads are nodes, not magic globals. They live at /root/Name and follow tree rules. class_name makes them feel global, but they still initialize in order.”
Related Issues
For signal issues across autoloads, see Godot Await Signal Never Completing. For tween lifetime issues that interact with autoload patterns, see Tween Chain Stopping Midway.
Add class_name, match autoload name, order dependencies top-to-bottom. Clean singleton access.