One side of cube texture flipped, how to fix?

Hello everyone,

While I am not new to Unity, scripting, or game development, I am somewhat new to materials. I know what they are and how they work generally speaking, but I don’t know some of the finer points.

I currently have a material that looks like this:

[29733-wall+material.png|29733]

Here is the error one side of the cube looks like this:

[29734-material+error.png|29734]

As you can see, one of the textures is flipped on one side of the cube. Since this material is being applied to a cube prefab in my project this is how it looks in-game. The cube is supposed to represent walls in a maze so I would like each wall to have the correct texture and not a reversed one. Is there a simple, or even difficult, way to fix this? I feel like this would be a common issue yet I have not been able to find anything about it.

Any help is appreciated. Thank you,

Portable_Hobbit

using UnityEngine;

public class FILENAME : MonoBehaviour {

	//Flips the UV on the backside of the cube so it matches the front and sides
	void OnValidate () {
		Vector2[] uvs = GetComponent<MeshFilter> ().sharedMesh.uv;

		uvs [6] = new Vector2 (0, 0);
		uvs [7] = new Vector2 (1, 0);
		uvs [10] = new Vector2 (0, 1);
		uvs [11] = new Vector2 (1, 1);

		GetComponent<MeshFilter> ().sharedMesh.uv = uvs;
	}
}

If you are using something from a modeling program, then you want to fix the uv in the modeling program. If you are using a Unity cube, you will need to edit the Mesh.uv to flip the values for that specific side. I decoded what vertices belong to what side for a built-in cube in this answer:

http://answers.unity3d.com/questions/542787/change-texture-of-cube-sides.html