In the Dynamic Color Change video, you create a lerp function to nicely change the color of the cube. My question is if yo...

In the Dynamic Color Change video, you create a lerp function to nicely change the color of the cube. My question is if you add it to the OnCollisionEnter function it doesn't work. How is it possible to check for the collision first then run the Color.Lerp in the Update()? Thanks.
  • veggicide replied
    Never mind, I used a boolean to accomplish it.
  • Jonathan Gonzalez(jgonzalez) replied

    Glad you figured it out. It’s original done in update because that allows it to gradually change color. If it’s done in OnCollisionEnter it happens very quickly and the effect doesn’t get to complete. So using the collision function to enable/disable a bool which determines when to lerp is a suitable solution.