I'd like to move the a mesh's uv.x value += 512 so it displays a different version of the objects skin that sits inside the same texture.
I've seen this:
mesh.Clear(); mesh.vertices = newVertices; mesh.uv = newUV; mesh.triangles = newTriangles;
Which seems to stretch or shrink the skin.
The end goal to is to only move certains vertices so I have some of the skin coming from one side of the texture and some of it from the other side.
Anyone know what I'm talking about?
asked Mar 17 '10 at 05:58 AM
1) Have you consider trying to achieve the effect by manipulating a material rather then animating a mesh's uvs?
Materials with texture have a tiling xy AND an offset xy.
I would highly recommend experimenting with the material in the editor before writing your script to automate it.
You will need to adjust the tiling to get the new skin to work. This will have the effect of stretching or shrinking the skin until you get it right. Next, manipulate the offset x or y. This will slide the entire texture map across the surface of your object.
Once you understand how get control over that, then write the script that manipulates the material.
2) It is difficult to understand your question without seeing it. Can you post an concept image that describes the look you are going for?
answered Mar 17 '10 at 06:28 AM
Offsetting only a few triangle's worth of UV's is going to be needlessly complicated.. However, if you wish to offset the entire UV set of an object, i wrote this..
answered Sep 03 '10 at 05:12 AM
Don't know how old this is, but I wrote a script that let's you slide UVs in the editor visually while still batching. It's a little buggy, but it works :)