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

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4752
    veggicide
    Participant

      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.

      #23007
      veggicide
      Participant

        Never mind, I used a boolean to accomplish it.

        #23008
        Jonathan Gonzalez
        Participant

          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.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘In the Dynamic Color Change video, you create a lerp function to nicely change the color of the cube. My question is if yo…’ is closed to new replies.