Hi, I’m having a little problem.
I want to change a texture child from one gameObject but all children with the same name change as well.
Any help?
gameObject.transform.Find(“Eyes”).renderer.material.mainTexture = eyes[2];
Hi, I’m having a little problem.
I want to change a texture child from one gameObject but all children with the same name change as well.
Any help?
gameObject.transform.Find(“Eyes”).renderer.material.mainTexture = eyes[2];
well when u change the texture of a material[thats what ur doing above]… all the other gameobjects using that material also get effected… so if want to change the texture of a single object make sure the material assigned to it isnt used on any other object.
also use GameObject.FindChild(“childname”); if ur searching for the child object…
I can’t have a material for each gameObject because i’m spawn them a lot of times.
Any other ideias please?