I don’t understand time.time; Is it one second? 30 frames?

Forum Archive I don’t understand time.time; Is it one second? 30 frames?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6875
    John Gallino
    Participant

      I just dont get how long time.time is supposed to be?

      #26113
      Jonathan Gonzalez
      Participant

        It’s the time in seconds since the start of the game. The last value in Color.Lerp is between 0-1. 0 being the color has not transitioned, and 1 being fully transitioned. Since we use Time.time as that value and we used Color.Lerp in the update method it will automatically change this value for us once one second has passed since playing the game, changing the color. 

        Depending on how much you want to fine tune this, you could create a separate method that iterates this over time to get a smoother transition. So every second you could increase that float value by 0.1 then you’ll see incremental changes in the color slowly lerping. Hope that answers your question. 

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘I don’t understand time.time; Is it one second? 30 frames?’ is closed to new replies.