It’s not exactly automatic, but it’s really easy. But you probably wouldn’t need to use that and a Timeline at the same time. Let me show you what I mean.
Using a Timeline node, you can achieve a nice, easy, trigger-able transition. Here’s how you might set that up:
Just create a track in the timeline that spits out a value between 0 and 1, and use that as your alpha input for the Lerp node. Bonus: if you make your timeline keys use cubic interpolation, you’ll get a nice smooth (non-linear) transition without any extra setup.
Here’s what it looks like when you use cubic-interpolation in your timeline track:
If a Timeline node doesn’t work for your situation — say you need two colors to always be blending, rather than transitioning only when triggered — there are plenty of other possibilities. You can use any imaginable technique to feed the Lerp node’s alpha parameter, as long as you’re feeding in a value between 0 and 1.
Here’s an example of using the player’s current “altitude” (Z-axis location) to blend between two colors, updated every tick:
In that example, the color look more like ColorOne
when the player is closer to the ground, and more like ColorTwo
when the player is closer to the value specified by the MaxTransitionAltitude
variable.
Finally, here’s an example of how to use the ease-in-out node to “smooth out” the curve of the blend based on the player’s Z-axis position:
You actually might not need to ease your alpha values, depending on what you’re doing and what you think looks best. But that’s how it can be done.
Hope that helps clear things up!