I am making a platformer game where there is a Main Menu with the entrances to all the levels (different scenes). However, I don’t want the player to be able to enter all levels, I want them to have to beat each level and advance in difficulty.
I did manage to use static variables and DontDestroyOnLoad to make the door unlock once you reach the end of a level, but when I come back into the main menu, the door respawns itself again, blocking access to the level access.
Is there a way to tell Unity to stop spawning a GameObject, or to destroy it if it spawns?