I am very new to Unity and working on building my first game. At the moment I have a single scene and when the player dies, a panel is displayed on the canvas asking them to press Enter if they want to start again. Ultimately I want to build levels (which I understand are additional scenes) for my game and when the player reaches the end of 1 level, there is a transition that shows them their stats before loading the new level. I have read a few different forum posts and there seems to be conflicting views on how to handle level transitions and game over. Some people say to create a scene and others say to keep it in the canvas.
I just have no idea what is best practice and when the pros and cons are of each approach? Would be interested to hear some opinions on this.
There is no ‘best practice’, because it depends on your game and your target device: what’s a good practice on mobile maybe a bad or inefficient one on desktop and if something is good on desktop it maybe a crude battery-killer on mobile, etc.
If your levels are small, you can keep them in memory. If your levels are big, you will need to unload them, so you will build separate scenes and load/unload them as you go.
As the developer of your game it’s your job to decide what is the best for your game.
Depends on how you intend to design your game, specifically what does a “level” mean. For example, every level could be a separate scene which replaces all previously loaded scenes. Alternatively levels could just be the same scene but you update a few variables to change the way the game functions (such as up the difficulty or instantiate different enemy prefabs). A level might be an additive scene that you load/unload as content for a main gameplay scene which always stays running.
The same things can all be said about what “game over” means for your game. You might want some full screen cut scene, you might just want to pop up a single UI window, you might want to just kick people back to the main menu. You’d accomplish each differently, and there is no right way, just whatever way works best for what you are trying to create.
Thank you very much for your comments, they are really insightful. I think for the game I am currently working on, separate scenes will be better because they levels are very different.