A smart UV project with all objects fully selected will make a UV map on each object but will take in consideration all faces when placing them into the 1001 space. In the UV Map list Blender will use the selected UV Map for each object when in multi-object editing mode. Is there a way to UV map the built-in primitives? Or perhaps I am thinking about this wrong. I am making a game made pretty much entirely out of the built-in cube primitives. In addition to this, most all the textures will be simple colors (red, green, blue, etc).
Hexagon Uv Mapping Tutorial
$begingroup$
Unity Uv Editor
I want to create a game with a Minecraft style world. Now I need uv mapping for some cubes in my game. But I could not find any good tutorial in the internet. I want to use the following texture with an uv map:
Each side of the cube has a texture with 64x64 pixels. The dirt texture on the right side has to be the top of the cube.Can anyone tell me how to use uv mapping in my case?
$endgroup$
1 Answer
$begingroup$
You can specify UV coordinates in Unity: https://docs.unity3d.com/ScriptReference/Mesh-uv.html
The UV coordinates go from 0 to 1, and the index in the uv
array corresponds the the vertex with the matching index in the vertices
array. This Unity Answers post may prove useful. It lists the vertices in Unity's cube primitive. The top face is first in the vertices, so you would map the uvs of the top face in the first four indices of the uv array like this:
I'll leave it to you to figure out the rest of the faces. Of course, assigning the uvs in a script would be more ideal only if you are generating content at runtime, so making your own mesh in a program like blender would be more ideal ... or you could make a script that runs in the Editor to create a new mesh for you based on the cube primitive. You can do this using the AssetDatabase interface.
$endgroup$