Godot Version
Godot 4.4.1
Question
In an input system im working on, i noticed that with multiple autoloads in my project, _input() runs in the opposite execution order compared to _ready(), _process() and _physics_process().
Below ive written out how to replicate my issue.
Steps to Reproduce:
-
Create three autoload scripts (AutoloadA, AutoloadB, AutoloadC)
-
Add them to Project Settings → AutoLoad in that order:
-
Add this debug code to each script:
extends Node
var limiter = 1
var process = 0
var p_process = 0
func _ready():
print(name, " _ready()")
func _input(event):
if event is InputEventKey and event.pressed:
print(name, " _input()")
func _process(delta):
if process >= limiter:
return
print(name, " _process()")
process += 1
func _physics_process(delta):
if p_process >= limiter:
return
print(name, " _physics_process()")
p_process += 1
- Run the project and press any key
Expected Behavior:
All methods should execute in the same order (top to bottom):
AutoloadA _ready()
AutoloadB _ready()
AutoloadC _ready()
AutoloadA _physics_process()
AutoloadB _physics_process()
AutoloadC _physics_process()
AutoloadA _process()
AutoloadB _process()
AutoloadC _process()
AutoloadA _input()
AutoloadB _input()
AutoloadC _input()
Actual Behavior:
_ready(), _process(), and _physics_process() execute top to bottom, but _input() executes bottom to top:
AutoloadA _ready()
AutoloadB _ready()
AutoloadC _ready()
AutoloadA _physics_process()
AutoloadB _physics_process()
AutoloadC _physics_process()
AutoloadA _process()
AutoloadB _process()
AutoloadC _process()
AutoloadC _input() ← Only _input() is reversed
AutoloadB _input()
AutoloadA _input()
Is this intended?
If so, is there any way that i can make _input() get executed in a different order for my autoloads?