I searched the scripting reference but cannot find a way to change the texture of a object in code? Can anyone please help me?
Thank you in advance!!
I searched the scripting reference but cannot find a way to change the texture of a object in code? Can anyone please help me?
Thank you in advance!!
Hi,
Quick search into the unity doc
http://unity3d.com/support/documentation/ScriptReference/Material.SetTexture.html
cAyou.
Ah, okay… That gave me a push in the right direction. Thank you… I am using GameObject.renderer.material.mainTexture=texture;
The difference with SetTexture is when you have more than only one texture attached to your material (for example, main and normal map). That let you choose the texture you want to change