0

Color Lerp Coroutine equivalent

Lux Creativity 3 years ago updated 3 years ago 1
Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

I'm trying to create a color lerp that is triggered in the middle of an On Enter path.

I need the color lerp to happen over a set time and after the lerp is completed I need to continue down the On Enter Path.

What I'm really trying to transcribe is the equivalent of this:

for (float t = 0.0f; t < 1.0f; t += Time.deltaTime / fadeTime) 

{

Color newColor = tranitionSphereMat.color;
newColor.a = Mathf.Lerp(alpha, 0.0f, t);
transitionSphereMat.color = newColor;

}

Any help is very much appreciated.


Edit: this is what I have but it's not working