Flipbook material animation lag

I’m using flipbook on a material to animate the face of a character chewing while eating. It’s a four frame loop from a 1024x1024 texture and it happens during 3 seconds, then the material gets back to “regular face”.


Using set texture to call the animation.


Material animation detail.

Sometimes, the chew material doesn’t animate. I’ve duplicated this material for every character with different faces for each and if it doesn’t work with one, it just won’t work with any other on that game session. I see that the material is set because the face has a different expression but it does not animate. Resetting the game usually solves this, but every now and then the animation gets stuck again and I don’t know why.

Any idea about what am I doing wrong? Many thanks for your time!

I’ve also realised that sometimes only two frames of the four frame animation play. This happens after long sessions of more than 10min play. I wonder if it may have something to do with the game struggling to render the animation?

I’ve realized this happens with any material I animate using this setup, so it has nothing to do with the texture size. For example, a rotating texture of 256x256 will also animate sloppily skipping some of the frames making it look like stop motion.

I’m attaching a couple images to better show my problem:

This is the animated material I’m using:
animation-error-material

And this is the animation lag while playing:
animation-error

You need to set the master material everytime you want that animation to play.

What object is the material on? Is it a widget item? Or a physical item in 3d space?

Thanks for answering but I found out the reason why this was happening. It was a floating point precision error that occurred by not specifying a period in the time node on the material script, as time in the game progressed the ever increasing time parameter eventually distorted the animation phase. I did this no matter the material or animation technique so that’s why all the animations got laggy.

This tutorial helped me figure it out: