How to make a model with an animated texture?

For example, if I had a man made of lava, how would i make the model look like lava is flowing down its body?

Is there a way to set up the uvs and an animated gif to achieve this? Also how would i do this without seams? Thanks.

I’m not sure how it will turn out, or if it will even look good, but if you just want the lava flowing down his body, make sure the texture is repeatable, as in the top end of the image continues from the bottom end, and the same from left to right.

Through scripting, you can change the materials offset, which is basically where the texture is placed compared to it’s standard position. Everything that rolls “off the object”, will be filled in from where the texture should be missing, if that makes sense.

Now to change the offset do like this: (C#)

//Define the offset vector that we will update, and use to change the offset:

Vector2 offset;

void update (){

//Update offset to later use:

offset = renderer.material.GetTextureOffset(“_MainTex”);

//And apply your value for offset change

renderer.material.SetTextureOffset (“_MainTex”, new Vector2(0, offset.y + offsetchangespeed));


By this you change the offset every frame by offsetchangespeed, compared to what the offset was in the last frame.
If you want to do the same just along the x-axis, just use offset.x instead of offset.y, and put it in the x-part of the vector2 :slight_smile:

Hope this helps.

In addition, i think its hard to get a nice result without using seams, but depending on how complex your model is, you just need to make sure that the seams are all vertical through the model, the texture is placed properly, and as i said, make sure its repeatable to avoid nasty edges where the texture clips.