How to prevent object from getting deleted when changing scenes?

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

I am making a game which has a pause menu, it is a Control node which should be present for every scene, however, it would be better if I didn’t need to add it manually for every scene, how could I do this? I have some vague memories of objects which got added during runtime in Godot 2 didn’t get deleted when changing scenes, but that seems to have changed with Godot 3.

Thanks in advance.

:bust_in_silhouette: Reply From: kidscancode

You’re looking for a Singleton. You can add any script or scene to the “Autoload” list in Project Settings, and it will be loaded and present in every scene. This functionality is the same in 2.1 and 3.0.

See here for details: