How to disable an object (stage 1) and enable the next object (stage 2), and so on...?

I’m creating a game similar to Breakout, that uses a single scene in Unity. Using C#.

I have 8 levels. Each of these 8 levels are already created as 8 parent empty objects with the necessary assets as child objects (such as more bricks or different layouts of bricks) under each of these 8 parent objects.

When the game starts, I have the Level 1 parent object enabled, and the other 7 levels of parent objects deactivated.

I want the user to be able to play Level 1, then disable upon completion, and enable Level 2. And so on…

How do I achieve this series of level progression using objects as levels that are disables then enabled to the next level?

I’m already tracking score in a script, btw, so when a player reaches a score of 10 for example, that is when I want the user to go to the next level.

Put the parent objects into an array and loop through it when you change level and enable the index in the array that matches level you want to show.

But what if you want to replay a level? If the bricks are prefabs in the scene, you’ll have to reload the scene to get destroyed bricks back. Maybe it would be better to have prefabs in the array and load only the needed level from Resources folder when you go into a level… just a thought :slight_smile: