Cube shows image same on all sides?

hey, im new to the program, im working with a cube that shows a tree.png image. when i rotate the game n it shows the other side of the cube its upside down. a few sides of the cube shows the tree upright but other sides show it upside down, how do i make it so the cube shows the image upright on all 4 sides.

thanks heap

I don’t know, if there is an easy way in Unity. But you could model a cube in your favorite 3d modelling program and adjust the texture mapping there. After that you import the cube into Unity.

This is a copy of my answer Here : UV mapping - Unity Answers


I have listed all the ways to custom UV map a unity cube here : Apply uv coordinates to unity cube by script - Questions & Answers - Unity Discussions

Imagine looking at the front of the cube, the first 4 vertices are arranged like so

//   2 --- 3
//   |     |
//   |     |
//   0 --- 1

then the UV’s are mapped as follows :

theUVs[2] = Vector2( 0, 1 );
theUVs[3] = Vector2( 1, 1 );
theUVs[0] = Vector2( 0, 0 );
theUVs[1] = Vector2( 1, 0 );

//    2    3    0    1   Front
//    6    7   10   11   Back
//   19   17   16   18   Left
//   23   21   20   22   Right
//    4    5    8    9   Top
//   15   13   12   14   Bottom

So where the UV’s for Vertices 2 is ( 0, 1 ), so is 6, 19, 23, 4, 15.

You can test this by replacing all the zero’s with 0.5, then check every face of the cube has the same portion of the image, and rotated the correct way (not inverted) . Note if standing at the origin looking up the positive Z-Axis, Right is your right.

for example this script would map the TOP of the cube to any UV coordinates of a texture you like :

#pragma strict
// TOP

function Start() 
{
    // Get the mesh
    var theMesh : Mesh;
    theMesh = this.transform.GetComponent(MeshFilter).mesh as Mesh;

    // Now store a local reference for the UVs
    var theUVs : Vector2[] = new Vector2[theMesh.uv.Length];
    theUVs = theMesh.uv;

    // set UV co-ordinates
    theUVs[4] = Vector2( 0.5, 1.0 );
    theUVs[5] = Vector2( 1.0, 1.0 );
    theUVs[8] = Vector2( 0.5, 0.5 );
    theUVs[9] = Vector2( 1.0, 0.5 );

    // Assign the mesh its new UVs
    theMesh.uv = theUVs;
}