How to best implement global Inputs?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Oian


How would you implement something like “toggle fullscreen by pressing F4” in your game GLOBALLY (meaning you should be able to toggle fullscreen mode no matter at which point/menu you are in the game)?
I know how to code it on a scene by scene basis. But when the scene changes i have to code it all over again.

Would a singleton like “Global_Inputs” or something be a a good option?

:bust_in_silhouette: Reply From: yrtv

Anything global goes here Singletons (Autoload) — Godot Engine (stable) documentation in English

Alright, this confirms my suspicion then. Thanks

Oian | 2021-02-13 20:54