SetAnimationFrame problems
by Arden · in Torque X 2D · 01/27/2011 (5:31 pm) · 2 replies
Hiya All, not sure if some of you have some experience with this, but when I'm setting the animation frame manually, like in:
AnimatedDestructibleObject.SetAnimationFrame(1);
Sometimes frames will be skipped, and be unavailable.
For instance, I have an animation using 11 frames, the last one being the building being destroyed.
Frames 5 and 10 (starting from index 0) are being skipped all the time.
This is really frustrating, and I have spent hours remaking my animations and looking at the frames to no avail.
Any ideas to what could be causing this?
Thanks,
Jeff
AnimatedDestructibleObject.SetAnimationFrame(1);
Sometimes frames will be skipped, and be unavailable.
For instance, I have an animation using 11 frames, the last one being the building being destroyed.
Frames 5 and 10 (starting from index 0) are being skipped all the time.
This is really frustrating, and I have spent hours remaking my animations and looking at the frames to no avail.
Any ideas to what could be causing this?
Thanks,
Jeff
#2
Cheers!
01/27/2011 (5:56 pm)
Yea, I came to the same conclusion as you; I basically started to update it as part of the ProcessTick and created a function:public void UpdateAnimationFrame (float aDeltaTime)
{
if (System.Environment.TickCount - lastTick >= GuiTextUtils.Instance.timeSecInteval)
{
AnimatedDestructibleObject.SetAnimationFrame(CurrentAnimationFrame);
lastTick = System.Environment.TickCount;
}
}Cheers!
Torque 3D Owner Will O-Reagan
Modern Intrigues