- Home /
How to rotate a UV/ texture?
Hello, I am quite new to Unity but I came up with this "issue". I need to rotate some texture of and object in 90º so it fits nicely, the problem is I can only change the texture size but I can't rotate. I have seen that there are scripts to do this, but there1s no other way of doing it without the need of code?
If the only way to do it is using script, could somebody explain it to me how to do it?
Thanks in advance.
Answer by · Oct 05, 2017 at 08:03 PM
The best way to do this is to create a custom shader. You can also just rotate the texture in Photoshop.
https://forum.unity.com/threads/rotation-of-texture-uvs-directly-from-a-shader.150482/
Answer by Newstage · Oct 05, 2017 at 08:08 PM
Yes, alright thanks.
If you allow me to ask, how do I use the script? I need to create one in Unity, add a new component for script and etc? Like this: http://www.shaderslab.com/demo-96---uv-rotation-with-matrix.html
I really recommend just rotating the texture in Photoshop unless you want to rotate like an animation at runtime. With an new shader you will probably change how your object looks. Do you really need to do this at runtime?
Absolutely not, it's just because it's weird that Unity doens't have this function, you know I'm co$$anonymous$$g from Blender and this was really easy but I thought of using a shader so wherever I needed to rotate It would not be needed to go to gimp or PS for example, but as this is a rare case, wich the texture rotated in 90º on blender was nice but when importing the model I couldn't do the same xD I think I will stick to the ps ou gimp since I am quite new to shader code too and I don't need it as you said so, thank you
If you created the model in blender, you should rotate the UV there. Unity is not a modelling tool. Unity is just an editor to put things together. It's not ment to edit textures or models. You import them in the way you need them. If the texture doesn't fit to the model you either have to change the model or the texture.
But it was what I did, I rotate it under the influence tab (on blender) packed and saved on the unity asset folder, but when putting everything together on unity it won't go rotated. But I'll test here if it would needed to rotate all uvs separately
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
A shader that rotate the texture on an object 1 Answer
Distribute terrain in zones 3 Answers
Isolate a UV Island (aka Shell) 0 Answers
Mesh texture not properly rendered 0 Answers