So I want to see if I understood it correctly, at the beginning of the level isTransitioning is set to False. So when it runs OnCollisionEnter “for the first time”, nothing happens in the if statement and goes to the switch statements. Once either StartCrashSequence or StartSuccessSequence is called, isTransitioning changes to True. So if a second collision happens, nothing will trigger because the if statement will stop the method.
When is isTransitioning set to False again? Does this automatically happen once the level is reloaded or goes to the next level?
Yes, you have this right. Everything gets destroyed and reloaded when the scene reloads. It’s like you just started playing the game for the first time. The only exceptions are things that are told explicitly to not get destroyed (using DontDestroyOnLoad
)
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.