- Home /
Material emission animation through script is not lighting anything
So, I have an animation of an emission color of a material, that goes from black (0.0f) to red with HDR intensity of 2. I change the material emission color through script in an Update() and I have a .anim that changes the color I set through the script in every update tick.
The animation works just fine, the problem is that this emission color is not lighting anything in the scene, static nor dynamic elements. I baked the lighting and I'm using light probes. What am I doing wrong?
Thank you.
P.S.: I'm not animating the material properties directly through the animation because it would go crazy, like giving me random animation curves or different emission colors, and I get the 'MaterialPropertyBlock is used to modify these values' warning.
Answer by NicoLocke · May 10, 2016 at 03:39 PM
It works with just this line:
DynamicGI.SetEmissive(GetComponent<Renderer>(), yourcolor);
Thank you
Your answer
Follow this Question
Related Questions
Emission/ Emission Animation importing from Blender 0 Answers
Certain colors of emissive material causing white outlines on objects 1 Answer
Surface shader: modify the emission with lighting? 3 Answers
Realtime emission material during runtime 0 Answers
Getting an extremely bright object (the sun) visible from an extreme distance? 2 Answers