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

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

  • Jonathan Gonzalez(jgonzalez) replied

    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.