Hundredths timers not working

Hello, like many, I have some trouble understanding how timers work.

My problem is that I can’t get the hundredths to work.

Here is my code, if someone can help me :

float time  ;
      
    void Awake () {
       
        time = (int)Time.time;      
    }

    void Update()
    {if (myCondition) {    
GetComponent<Text> ().text = string.Format("{0:00}:{1:00}:{2:00}",Mathf.Floor(time/60),time%60,(time*100)%100);        
        
    time = (int)Time.time;

    }

Time.time is in seconds.
You are casting it to an int
int can only hold whole numbers.

By casting to an int, you are throwing away any partial seconds. For example you are turning 35.32 seconds into 35 seconds even. Stop casting it to an int.

2 Likes

It works, you are too strong thank you !!!