Hello everybody!
I have al little problem with my mobile 2D Platformer.
The game setup is the following:
A player is initialized in the first scene, a little in game cutscene is started.
When it’s finished, the player is allowed to exit to the left into another scene
(similar to DuckTales game in-level-transitions).
I gave the player a “DontDestroyOnLoad”-Script, and it worked well.
However, when coming back to that first scene, the camera freaked out and the UI-Buttons where nowhere to be seen. I think this was because the camera was searching for a GameObject with the “player” tag, but loading that first scene loaded another player and the cutscene player again, even though I gave it a script which made a public static boolean called destroyed, and if that bool was true, the cutscene would have been destroyed, otherwise the cutscene would run, set the bool to true for the next loading and delete the cutscene (with Destroy(this.GameObject)).
In the end, I think I could fix the player problem myself after some trial and error (I thought maybe loading the player scene once and when the player tries to enter the scene again, the game leads the player to an exact copy of the scene without the player initializing), but I have no idea how to solve this cutscene problem, which will ruin my whole project if I can’t fix it.
Please help!
Thanks in advance,
Luca