- Home /
How can you get multiple materials/textures on the same object in unity 5?
I have a bookshelf object that has a single material placed on it currently. However, I would like to have two textures on it placed on different spots that are visible at the same time. Basically, I want a specific texture for the frame of the bookshelf, and another for the inside of it, but I do not know how to do it.
I have tried figuring this out by searching the web, but the end results of each thing that I've done doesn't satisfy what I wan. Either that, or the ways described to go about doing this are way too confusing for someone like me who hasn't dealt with multiple textures up until this point (or even textures in general really).
What I suppose you want is multiple UV maps, what program are you using to make your models?
Sorry I took so long to reply back. The modeling program I'm using is Blender. Also, what are UV maps?
UV mapping controls how a texture is applied on a mesh's surfaces. Blender, like most 3d modelling applications, lets you create and edit the UV mapping of a mesh. This, however, is not specific to Unity and thus outside of the scope of Unity Answers. Blender UV mapping tutorials are readily available on the net.
When generating a mesh from code in Unity, it is possible to assign triangles to one or more submeshes, each of which corresponds to one material. The User $$anonymous$$anual and Scripting API has more information on this.
Answer by Firedan1176 · Apr 25, 2016 at 03:51 PM
You can have multiple materials on the same object in Unity under the Mesh Renderer component. However, keep in mind that if you have multiple materials, that also means that your computer is accessing 2 files. What I would suggest you do is to cbake textures in your 3D modeling application (Blender/Cinema 4D/Maya). A UV map will take textures on your models in Blender and will put them all into an image document that can be applied inside of other programs (known as baking textures). I am not going to explain how this is done specifically, but I am sure you can find tutorials on how to create UV maps or Bake Textures inside of Blender.
Answer by SnooksV3 · May 10 at 09:21 PM
Baking is the same as applying materials to your object in Unity. It still uses multiple materials.
In order to UV map separate materials in Unity, you have to assign them a new material in your modelling program, thus the issue is still at hand.
What you need to do is separate your objects in your modelling program. Reducing the draw calls to only 1 or 2 for the "child" objects.
If you do this, make sure your colliders are also separate meshes on the root of the object, as disconnected seems will lead to issues in Unity.
The other approach is using a texture atlas if it suits your game.
Your answer
![](https://koobas.hobune.stream/wayback/20220612075409im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to Best Implement a Tileset 1 Answer
1 Material per Texture (Tiling) VS. UV Baked Texture 2 Answers
Textures not displaying properly in WebGL build 0 Answers
How to texture huge tile grids? 1 Answer
Which method is less intensive? 1 Answer