How to change the texture of a prefab

I am new to Unity. very new. I just downloaded Unity and I have a sample package loaded. The game has a number of prefabs, and I want to change the texture of one of them. For example, the game has an object that appears in various scenes - let’s say a box. The box is a woodgrain texture, but I want it to be a steel box. I can see the texture png file for the prefab. I can see the prefab file and meta file.

What do I need to do to just change the texture of that prefab so that every time an object instantiated from the prefab appears, it appears with the new texture?

Hi r.daneel,

to do what you want you just have to change the material of the prefab from its renderer component (in most cases the mesh renderer component). Once you changed it, all the game objects you’ll instanstiate from that prefab will have that material (and the texture attached to that material).

textures are linked to materials. you need to modify materials.

there should be a “Mesh Renderer” component which contains material associated with it. You should be able to modify here

hi,

Texture2D tempTexture = (Texture2D)Resources.Load("Image_name")as Texture2D;
obj.renderer.material.mainTexture=tempTexture;

obj is your game object.