impworks Logo - a grinning imp in flight

Watch out for Floating Key frames in Vue

Tuesday, July 29th, 2008

I was tinkering with an animation script for Vue when I discovered something I thought I’d share to save others scratching their heads…

I was using SetCurrentFrame() to set the key frame for the animation. I was later returning to an earlier key frame to apply a tweak to the same objects animation. The current key frame was a floating point variable: currentframe. To do the back step I was doing something like SetCurrentFrame(currentframe-1). Once in a while this was resulting in two keyframes very close together rather than a single key frame. The solution is straight forward – SetCurrentFrame(int(currentframe-1)) and SetCurrentFrame(int(currentframe)). That makes the problem go away.

Leave a Comment

impworks © Copyright Mark Caldwell 1996 - 2024