Topic was automatically imported from the old Question2Answer platform.
Asked By
Eidam
Hello,
please help! I have information window and I use this window on all scenes in my game.
Is possible make some scene, that will be displayed on all scenes, at the top. I don’t want to add this window on every scene separately.
Thank you very much!
PS: Sorry for my bad english, I hope you understand that(;
The easiest way I can think of, is to create an autoload script that loads the scene and put it as a child of the root node. Here are the steps :
Create a new script called GlobalScene.gd :
extends Node
func load_global_scene():
var global_scene = ResourceLoader.load("path_to your_global_scene")
var global_scene_instance = global_scene.instance()
get_tree().get_root().add_child(global_scene_instance )
Make it an autoload script, by going to Project > Project Settings > AutoLoad
Then load the GlobalScene.gd script by clicking on the folder icon, and then clicking on the Add button. Your script can now be loaded from any scene in your project.
Add the following line to the scripts of every scene you need to add your global scene into :