- Home /
Question by
daniel_oculus · Sep 06, 2020 at 06:14 PM ·
materialemissionemissive
Cannot access updated Emission Color value
How can I access the rgb values of a changing emissive material at runtime?
The problem
Every time I access: gameObject.GetComponent<MeshRenderer>().material.GetColor("_EmissionColor")
I only ever receive the emission values that the material started with, I've confirmed that this is the only material on the mesh renderer.
Additional Context
I have a scene that is updating the emissive colors from (0,0,0,1)
=> (1,1,1,1)
See example video below.
I'm updating the emissive colors via an animation controller.
I'm using Unity: 2020.1.0f1
All the game objects with changing emissive materials are using Standard Shaders
material.EnableKeyword("_EMISSION");
is already enabled, the issue is I can't read the updated values after they have been written
ezgifcom-video-to-gif.gif
(99.3 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613011336im_/https://answers.unity.com/themes/thub/images/avi.jpg)