- Home /
Emission material behaviour during runtime
I'm working on emission material and I'm little confused of this tricky behaviour.
Before hitting Play button material color and emission color are white. Start() call method that changes both color from green to red during 5 second animation.
Code used to modify material values:
GetComponent<Renderer>().material.SetColor("_Color", new Color(r, g, b));
GetComponent<Renderer>().material.SetColor("_EmissionColor", new Color(r, g, b));
The thing is that light on walls and floor from this material switch to green at the beginning and not changing even after animation is over and both colors are red.
What can I do to fix this issue?
Gif showing this issue: https://media.giphy.com/media/1ZDCkfL2rJrDUcBWGw/giphy.gif
Answer by hameed-ullah-jan · Oct 30, 2018 at 04:35 PM
you can only see the effect of emission after baking, and changing material emission's color runtime wont effect, it will show you the baked color.
Thanks for the reply. I thought so, but I'm still confused. $$anonymous$$y emmisive material is baked as white and changes to green after i start game so why I see green light ins$$anonymous$$d of white?
Is there any possibility to bake 2 different emissive materials (only different colors) so I can switch them during runtime?
Your answer
Follow this Question
Related Questions
How to make light-fixtures with emissive materials that can turn on/off? 0 Answers
How to get emissive materials to update and cast light during runtime 1 Answer
LWRP Lightmapping issue in 2019.1.11f1 when using emissive materials 0 Answers
Certain colors of emissive material causing white outlines on objects 1 Answer
Endless Baking even though all GI is turned off: 10/16 Bake Runtime | 1 jobs 2 Answers