Hello. My question is very simple - let’s imagine that my game has several chapters. And let’s imagine that the same scene occurs in several chapters, but with slight changes (characters are different, the environment is slightly different, and so on).
Is it possible to just create a new scene, copy everything from the old one and change it? After all, technically the number of sprites and other resources will not change, the scene keeps references to them, right? Or would it be better to write a bunch of scripts that will check what stage of the game we are in and arrange elements of the game at each level load? These endless checks (in an open world game) may load the system, although you do not have to create new scenes
You might have one scene that contains the main geometry of the room.
But then you might have another scene that contains the items for mode A, and another scene for mode B, and only one of those is additively loaded.
Another way is to just have specific control scripts on each object linked to the logic in your game state that will hide the candlestick once Ms Scarlet visits the ballroom.
The only issue would be baked lighting around the objects, but if you’re not doing lighting, no problem.
Details:
A multi-scene loader thingy:
My typical Scene Loader:
Other notes on additive scene loading:
Timing of scene loading:
Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.
Two similar examples of checking if everything is ready to go:
Kurt, can I ask one more little offtop question. In my game, there’s a point where you have to put a “white noise” effect on a 2D character, as if he’s in a disturbance. I’ve been working in Unity for a long time, but I have no idea how to do it at all (I don’t want to draw 50 frames of animation with noise again), is it possible to put white noise animation over the character and have it rendered only on the character sorting layer, not around it?
Here are a random collection of different ideas to play with:
use a separate noise texture and a shader that blends the two textures together, perhaps as a percent so you can bring the effect on gradually and then take it back out smoothly
write a pre-processing editor script that makes the noisy textures out of your source clean images and saves them
programmatically read the texture and modify it at runtime to add the noise
shine a light projector only on the character (using layers) that has a dappled light cookie on it