Godot Version
Question
i have this func. if i press “menu_key” it print out “Test Key” two times.
How to prevent this from happening
On the Node itself the Process Mode is “Always”
And my game didn’t pause ether, because the function runs twice (The HUD Scene is a autoload)
EDIT: the Script is only attached to one Node (the HUD) and this also happens if the autoload is disabled
func _process(delta):
change_score()
display_hud()
display_key()
if Input.is_action_just_pressed("Menu_key"):
print("Test key")
if Engine.time_scale == 0:
Engine.time_scale = 1
else:
Engine.time_scale = 0