Super scene for next level

Quick question. Could you create a super scene that includes all the other scenes that make up the minimum level e.g. BG, Start, Exit, Player, etc., and use that super scene to create the next level?

1 Like

Honest answer i am actually not sure.
I imagine it would be possible to create a base scene with all the components you need to make it and then use that base scene as a start point to create your levels but i would give it a try in another project and see if everything works and then apply it to your main project.

Hope this helps

just tried it, and yep it is doable.
but, backup your project before trying to play around with it.

what i did notice tho, i had to remove all the references to next level from the inspector before messing around with duplicating levels to change. since its down to the way we are dragging a packed scene into the inspector, this could end up with errors since the next level is referenced in any single scene and if its not blank the level wont load in editor.

so in the test backup project, i removed all the next level references.
then duplicated the level scene, saved it as template.
then for the next level, i just duplicated the template and renamed.
then set up the next level in the inspector of level 1 to point to the next level, whilst leaving the template blank.

but, it seems to work.

Yes, in fact there is a built in way to do this. You can create a base level scene that isn’t intended to be used as a level itself, but it can contain all the necessary building blocks of the level such as the start, stop, tile map, and player scenes. It will also contain the script. Then, when you want to create an actual level, you can click on Scene -> New Inherited Scene then select the base level scene you just created. This will create a new scene that inherits all the nodes from the base scene. You can then modify this scene as necessary to create the unique level. Note that anything modified on the base level scene will affect the scenes that inherit from the base level scene as well, which is the intended effect.

As the others have suggested, make sure you backup your files before trying this or try it on a separate project first. Doing this the first time can be a bit difficult to understand, so keep things simple as first and play around with various nodes at both the base scene and actual level scenes to see how the changes work.

3 Likes

That is very good to know, thanks! This is something I expected to be able to do, but I had not enough information to form a reasonable question. :slight_smile: Inheritance is one of the most valuable properties of Object Oriented programming, and I am used to that from my former life as a gainfully employed software developer. Unfortunately that life is over, as I now have Parkinson’s, which has made me unable to work. On the bright side, now I have nothing else to do, so I can play with all the wonderful courses here that I bought the lifetime membership to gain access to, but never had time to actually work on!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms