Quantcast
Channel: Latest Questions by greatUnityGamer
Viewing all articles
Browse latest Browse all 99

Counting Down Timer But My Variable is not reaching Zero ever, Why?

$
0
0
ok this is my code and it never seems to reach zero. I don't understand why my Variable myTimer doesn't reach zero ever. I even put a debug messege thing to tell me if myTimer more than zero and also when my timer is zero. but the one to tell me when my timer is zero never appeared cause like i said it doesn't seem like myTimer is reaching zero. The following code is in my Update() method As soon as user clicks key G, set myTimer to 4.0f (forseconds) //By the way myTimer is a float if( myTImer > 0 ) myTimer -= Time.deltaTime; //do something } else if( myTimer == 0){ //do something until count down something //when count that something //then set myTimer = -1 }

Viewing all articles
Browse latest Browse all 99

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>