# Libgdx Animation Timing

I'm having a small issue with libgdx animation.

I'm using getKeyFrame() to get the current frame of the animation and I'm updating the state time by adding on deltaTime in my update function for the object. The animation is not looping.

My problem is that the animation seems to play at different speeds depending on the frame rate. On my phone this animation plays particularly slow. My thinking was that the stateTime would cause it to skip a few frames when it's going slow, but this doesn't seem to be happening.

Here is the code;

        sprite = Animation.getKeyFrame(stateTime, false);
sprite.setRotation(angle);
sprite.setPosition(position.x, position.y);
sprite.draw(batch);


Has anyone else experience this issue.

• Maybe your delta time is wrong? – Laurent Couvidou Apr 27 '12 at 19:01
• The delta time seems fine. I tried doing stateTime * 100000 and that made no difference and I have changed the animation time with no difference. – OriginalDaemon Apr 28 '12 at 1:20
• Maybe a bug in libgdx, then... – Laurent Couvidou Apr 29 '12 at 15:55
• I'm hoping to spend some more time this week trying to find out if that's the case. I was just hoping that someone else had run into it at some point. – OriginalDaemon Apr 29 '12 at 18:10
• Based om depresscreate's answer, you may just need to upgrade to 0.9.3 – ashes999 May 1 '12 at 21:18

sprite = Animation.getKeyFrame(stateTime, true);