What is the correct way of assigning / changing a texture on a prefab as it’s being instantiated?
I’ve been trying to use the same logic that I’m applying to change a texture on collision (which works perfectly in that scenario):
hit.gameObject.renderer.material.mainTexture = someTexture;
Like:
prefabVar = Instantiate(prefabArray[i]);
prefabVar.renderer.material.mainTexture = someTexture;
This gives me some really weird results like meshes not rendering at all or ignoring transformations added later etc. (some of the prefabs actually show up with the right texture, but ignoring all transformations). The prefabs in question are all set as children of another gameObject that I’m applying some transformation too (dunno if this is relevant or not)