Material applied to a cube appears to change direction
Hi, I am a newbie to Unity, so apologise up front for what may seem like a simple question. I am using Unity 5, on a Windows 7 Laptop.
I have a Texture, that is bricks.
I have created a Material in Unity using the brick Texture.
Its not what I want to do, but to demonstrate the issue, I have created a cube, and I have applied the Material to the Cube.
The cube is level to the ground, rotated to 100 degrees on the Y so we can see two sides. As you can see, the bricks on the left hand panel are level, and correct, but those on the right hand panel have rotated. I have tried using both Texture and Material and experience the same problem.
The reality of what I am doing is to apply my Texture/Material to a building, and what I see is the same symptom where the brick direction changes each time the wall goes through a 90 degree turn.
I am sure there is a simple (ish) answer, can anyone help ?
Cheers
Craig
Answer by cjdev · Sep 27, 2015 at 06:50 AM
What's going on is that your UV set is aligned so that the square face on the left is correct but the face on the right is rotated 90 degrees in your UV space so that it's mapping the vertices in the wrong corners of your texture. To fix it just go in and find that square face in a modeling package and rotate the individual face on the UV editor so that it aligns correctly with your model.
Thanks @cjdev ... I did think that that might be the case for the buildings that I have had modelled, but didnt understand why it would be the case on a cube generated by Unity itself ??
Any thoughts ?
It's most likely because Unity unwraps the cube in a way that leaves the most edges connected, reducing the number of seams in the model. That unwrapping would look something like a t and because of the way it's done the side faces and front faces are at 90 degrees from each other. Not ideal for certain applications no doubt, but it's generally a trade-off between seams and orientation and it appears Unity went with the former.