So, the second if function is supposed to activate other screens in the game, as soon as it reaches the final amount of a jackpot. IT reaches and the timer stops as soon as it does, but my second if function is not doing what is supposed to do. So I took it out, and it works, but it doesn’t even allow me to fill in the Input fields for the jackpot to start increasing. Can someone please help me?
if (timerRunning1) {
timerValue1 += Time.deltaTime * 14.4 * (timerValue1F - timerValue1) / (finish1 - start).TotalSeconds;
Jack1.text = timerValue1.ToString ("F2");
//PlayerPrefs.SetFloat ("Jackpot1", float.Parse(Jackpot1.text));
//PlayerPrefs.SetFloat ("Jackpot1f", float.Parse(Jackpot1F.text));
if (timerValue1 == timerValue1F) {
print ("ALTO");
timerRunning1 = false;
PagPrincipal.SetActive (false);
Victoria.SetActive (true);
Debug.Log ("FUNCIONA!!!");
Invoke ("apagavictoria", 10f);
}
}
This question's title is the best worst title I've seen in a long time XD
– Socapex