Hi all, I’m trying to track how many times the rocket crashes and then use that to load a game over the screen. When I ever I play the crashCount is always 1. But never increases. Has anyone else had a go at this?
int crashCount = 0;
void StartCrashSequence()
{
if (crashCount == 3)
{
Invoke("GameOver", levelLoadDelay);
}
else
{
crashCount++;
Debug.Log("Just a crash ----------->" + crashCount);
isTransitioning = true;
audioSource.Stop();
audioSource.PlayOneShot(crashed);
crashedParticles.Play();
GetComponent<Movement>().enabled = false;
Invoke("ReloadLevel", levelLoadDelay);
}