Animated UV. Is it Possible?

Hi everyone,

Im new here.
Is it possible to create an animated uv in Unity?

If Yes, How? :?:

Im needing this to my current project.

Thanks!

Welcome to the forum!

Yes, it is possible to animate texture UV in Unity with a bit of scripting. The Mesh class allows you to access arrays containing the vertex and UV data (the arrays are in parallel - there is one UV coordinate for each vertex). When you assign a new array of UV coordinates, the model will be updated onscreen. You can just keep changing the UVs progressively each frame to get an animated effect.

1 Like

Great fast reply.
Thanks!

Or use the script in the Sewer Demo.

Or use “matrix” in your shader, if you only need them to translate/rotate/scale all as one. That should be faster.

http://forum.unity3d.com/viewtopic.php?t=34317

Also, for extremely simple UV animation where all you want to do is slide the whole texture vertically/horizontally, you can use the “offset” value of the texture.

file:///Applications/Unity%20iPhone/Documentation/ScriptReference/Material-mainTextureOffset.html

Thats actually the solution I would avoid whereever possible as it creates new dynamic materials and thus disables batching.

i would reccommend this possibility when you are using only 1-2 character per camera view. Because its easy to handle and its working fine. Further its not significant to batch 2 textures.

Also, if you’re looking at sprite-based UV animation, you might be interested in SpriteManager 2 for Unity:
http://www.anbsoft.com/middleware/sm2/overview

Brady,

I know I am interested in Sprite Manager 2 but I see that it is “coming soon” and takes advantage of the iPhone version of Unity.

I only have Unity Indie at this time but would enjoy taking advantage of the sprite manager features. I do plan on purchasing the iPhone Unity here soon, but just don’t have the money yet.

When is Sprite Manager 2 getting released? And will it only be available for the iPhone Unity?

Actually, SpriteManager 2 supports both Unity iPhone as well as “normal” Unity.

It should be “officially” released soon, but it is currently available to those who are interested in getting started with the current release candidate (there’s a 10%-off coupon in the SpriteManager thread for early adopters that is still valid).