In order to make sure that the player can transition between scenes in a controllable, easy to design way, we needed to build a system that sits on top of the LevelLoad system and doesn’t explode when you change scenes. The Level Manager script is a cool tool that fits this description, and is really easy to use!
The LM sits on a game object that does not get destroyed on load, allowing it to scoot between levels with ease. It has three values that change whenever the player enters a Spawner trigger: targetLevel, currentLevel, and previousLevel. Using these strings, the system can determine where it was, where it is going and where it is now. Once it knows where it is, it looks through the entire scene for objects of the tag “Spawner” and tries to find the one with a ‘scene partner’ value equal to the scene it just came from. Then it grabs that spawner’s spawn point, creates the player and camera, relocates it to the transform of that point, and updates its own information. With this we can switch between dungeons and overworld locations on button press, trigger enter, or some other scripted encounter.
Next steps for this system are to implement a camera fade to cover the hard screen change of the scene swap, add a loading screen and tell the player where they are when they enter a zone. The latter will most likely happen in the GUI manager, and moving the player’s data around will probably be handled by the Player Braincase, but keeping this stuff in mind for Beta and beyond will be good. Now that this whole thing has been fixed, I’m moving on to shooting cleanup, and enemy AI. Also, making tons of assets. Here’s one of them: