- Home /
Changing Emissive texture in C#
I've been trying to change an Emissive texture through C# and have gotten no results. I don't know how to achieve this. I've tried
renderer.material.SetTexture("_EMISSION",myTexture)
with no success. Changing emissive colors has been no problem for me, but I can't seem to find anything anywhere on how to change the map itself. Any ideas?
Answer by Namey5 · Apr 15, 2016 at 02:48 AM
You have to have the correct property name. In this instance, it would be:
renderer.material.SetTexture ("_EmissionMap", myTexture);
However, keep in mind that you will probably have to also set the emission colour and power values yourself, as these are 'black' by default.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Loop Animation of Textures 1 Answer
Surface Shader: Brick Texture problem 2 Answers
Assigning script-generated textures 0 Answers