Gradually increase or decrease Emission

I want to gradually increase and decrease the emission of a material at runtime via code without shaders. I could not find any documentation to get an idea of how to approach this. Any help would be appreciated :slight_smile:

Color.Lerp is all you need. The documentation has a really good example of using it, which does exactly what you want. All you need is to set it to the material emision color.

Maybe My question wasn’t clear enough. I want to gradually increase and decrease the emission intensity of a material. Color sounds about right. But I don’t know how to apply the emission intensity value to a color. I know a color in unity can be broken down to R, G,B & A. So where does emission intensity go? Can you give me a code example.? Thanks!

not sure it’s possible runtime…

Is that link not taking you directly to a thread with a working example at the bottom?

Joachim_Ante said:
“The shader only uses “_EmissionColor”. So you want to multiply the color with it. Effectively you have to pass an HDR color to it.”

And yes it’s a solution. but you cant manipulate the intensity directly by script. that’s what i tryed to say.

This works. The example code at the bottom works. Thanks

I does. Thanks :slight_smile:

Gotcha. You have been most helpful

Not important. Glad it works for you. I also learnt with you guys :slight_smile: in this thread. Thanks