Hi,
I want to change a material at run time:
the structure of the prefab is : the_prefab and a child
I want the child material to change:
var bash : Material;
function Awake(){
if(gamemanager.who==1){
//find the child
var victim=transform.Find("baby").gameObject;
//assign new material to baby
victim.renderer.material=bash;
print (victim.renderer.material);
//it prints the correct material but nothing changes
}
}
I double check the bash material it has a different texture
also I assign the bash material in the inspector.
Thank you