Make a scene inherit game objects from another scene

I want to have a scene that’s kind of a “default” scene for other scenes. I have some objects that I will exist on every scene.

What’s the best way to do that? Can I have a scene that works as a “parent” of other scenes, so I can just add to new scenes its specific elements?

Any other ideas?

Thank you in advance

There’s a template scene system: Unity - Manual: Scene Templates

Never used it but it might help to speed up the process, though I’m not sure if editing the templates cascades onto any scene using said template.

You could just make a prefab out of these objects, so editing the prefab is seen elsewhere, potentially.

Though personally I would - depending on what the object does - use either additively loaded scenes, or make the relevant objects DontDestroyOnLoad. You should also ask if yourself if these needs to be scene objects, and could potentially be scriptable objects instead.

1 Like

The scene templates could help (Honestly didn’t know about it) though, yeah, I doubt changing the template will change the “child” templates.

The other suggestions you gave were alternatives I’ve been thinking about. Gamemaker does have a “parent room” feature (Rooms are like Scenes on Unity), so you can just add stuff to its children, it’s very helpful… I was wondering it Unity also had something like that. It would make my workflow a little bit easier.

But thank you a lot for your reply :slight_smile:

1 Like

Once you go for additive scene loading you‘ll never want to go back again. :wink:

2 Likes

Does sound pretty useful. I’m a fan of any prototype-pattern systems. Which is, in a way, what prefab + prefab variants are. Having that at the scene level seems pretty useful. I believe Godot is similar to what you’re describing, as well, with everything being node based.

What is role of these objects you want across multiple scenes?

It’s basic controlling stuff for different levels, but they work the very same way on every level (for example, there’s a base camera that should always render to a texture). And since I’m not working alone on this game, and the other coder probably won’t ever mess with those objects, I’d rather she just create new scenes with the necessary objects there, easier for her, easier for me.

The template scene system is interesting because you can choose between “cloning” the objects or have the objects on the new scene referencing to the template, so if you change the template, it will change on the scenes created from that template.

It’s not as simple as in Gamemaker (nearly nothing in Unity is :smile: ), but it does the job.

Well that’s useful to know and probably means I should look at scene templates sometime.

But some of what you described could also be served by additive scene loading, to remove the potential of errors from any manual set up.