Hi all,
I am trying to implement a checkpoint system for the top-down shooter game. The game consists of different spawner game objects which get activated or deactivated when some conditions are met. For example, the game starts the first spawner game object active and it gets deactivated when 30 enemies are destroyed, which activates another spawner object, and when 40 more is killed second spawner game object deactivates, and a third spawner game object gets activated, and so on.
Now what I try to implement is that if the player dies before reaching the third spawner, the scene restarts, but this time, I want the first spawner game object to be inactive(since the player already beat that section) and the second one to be active instead(because the player couldn’t beat the second wave)
I tried some bools to mark the progress of the player(if the player beats the first wave a boolean gets triggered) and created methods activating and deactivating the necessary game objects according to the boolean but couldn’t manage to achieve what I want.
I don’t want to litter here with my lengthy code since first I want to ask if this is even possible? Can you restart/reload a scene with SceneManagment’s LoadScene method, and would that scene load with different game objects activated? (You start the game gameObject1 is active-gameObject2 is inactive, after some progress the player dies, restart the scene with LoadScene, and the scene loads with inactive gameObject1 and active gameObject2)
I could set up different scenes with my desired preferences, as in, in one scene gO1 starts active, and in another gO2 starts active but this feels like a bad design probably cause I would end up with 5-6 scenes just for the first level.
I am sorry for the long post but It was a bit hard for me to describe what I wanted and asking. Thanks in advance for the ideas and pointer in the right direction.Cheers…=)