Problem editing textures of material. [Solved]

I am trying to make a script that will allow me to automatically import images into unity, and then display them on a screen. The problem is, I can only seem to manage to edit the “MainTex”, and not the “Emission Texture”. This is really necessary trying to create a nice realistic screen-vibe.
I am using this line for editing the maintex:

GetComponent.<Renderer>().material.SetTexture("_MainTex", Texture);

And when I am editing the emission texture:

GetComponent.<Renderer>().material.SetTexture("_EmissionTex", Texture);

Now when I play my script I can see that the non-emission part (darker in the background) changes, but the emission is still the old texture. I get no warnings/error messages whilst doing this. I have been trying to fix this for quite a while now and I am really stuck. Help is very much appreciated!

Are you sure “_EmissionTex” is the name of the emission texture property in the shader? For the Unity standard shader, the property is called “_EmissionMap”

1 Like

That’s it! Thank you so much! Really stupid of me…