Walk cycle stutter

Hi all, wondering if you can help.

I have this walk cycle animation that was done in Flash, 30 fps with a keyframe every 2 frames.

In Unity 2dtoolkit the frames are running at 30fps each frame lasting for two frames (so the timing is the same as Flash)

When I move the character along the screen, the legs stutter.

I’ve tried:

  • varying the speed of horizontal movement
  • translating and fixed position movement
  • only moving every other frame
  • only moving when the frame number of the animation changes

Please watch this video

Any thoughts would be greatly appreciated. Thanks

Hiya, apologies for the rambling feedback, hopefully there’s a helpful nugget in there somewhere…


The stuttering in the video is because the travelling distance of the character is slightly quicker than the walking speed - it is ice skating very slightly.
The other tricky issue is that I don’t think walk cycles are actually a uniform speed - especially considering that the centre of mass or anchor point is not static in a soft-body character.


I think the solution depends on how the walk cycle was animated. Did you;
a) scroll a floor grid along at a constant pace and animate the gait to match, or…
b) eyeball it ?

Also, did you match the gait of the front vs back legs? (are they travelling at exactly the same speed and distance)

If you used (a) it should look ok if you move the character along every other frame at the same constant speed you used for the floor plane.

however,

If you eyeballed it, then you don’t have constant motion and will need to measure how far the limb has moved each keyframe. You’ll end up with a list of distances moved in each frame, and will have to apply that when the animation updates.

^ however, one possible solution might be to unhinge socket joints, allowing the whole leg to roam a little.
Example, if your front legs have a gait of 100px, and it turns out that the back legs span 120px, you could give the back-leg-socket the freedom to roam 10 pixels forwards and backwards.