How can I change the emission value during runtime using C#?

I want to make my character flash a bit green when he gets some health, but I do not want to change his entire texture, just make it more green. I tried looking on the forums for some solutions, but a good chunck of them were outdated.

2D or 3D character? What kind of materials are you using for your character?

If you can just modify the material color, that might be the way to go.

1 Like

It is a 3D project, but the characters are planes. I am using the stanard shader for them and a texture. Isn’t changing the material colour going to make the entire plane green?

UPDATE

Thanks! I can make the texture a bit green without making the entire material a solid colour. Although, I have another thing I want to change emission for. I want the enemies to flash white when they are hit, and changing the colour to white only seems to give the original material, so making them white only seems to be achieveable with emission change to white. Is there any other way of doing it?

1 Like

That’s right use emission or you can swap the materials…

Yes, but that was my initial question, how do I manipulate emission?