1
\$\begingroup\$

I apologize in advanced if this is a trivial ask, but I am wondering if it is possible to use an animation to change the color of a Text element from teal -> white without any lerp, i.e the color instantly changes. My current animation is only the one frame at 0:00 where I do the switch, but you can still see that the color is lerping even though it is the first and only frame. Am I missing something simple or should I just script the change? Fixing the problem is easy (Trivial to script), but I am just curious if there is something in the animation I can change to not have the color lerp?

I posted the question here as well, but I never have any luck posting on the Unity forums.

\$\endgroup\$
2
\$\begingroup\$

Inside your animation timeline, right-click on your keyframes and set their tangents to Broken -> Constant, as described in the docs on editing curves.

This ensures there's a discrete jump from the old value to the new when the animation reaches the keyframe, instead of a blend in between.

Unity documentation screenshot showing constant tangent mode.

\$\endgroup\$
  • \$\begingroup\$ This solved my problem. Thanks for baring with me. \$\endgroup\$ – whiskey golf Sep 14 '18 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.