Hi!
Expected behavior.
It depends on whether's it's set to loop or not (SkeletonAnimation::setLoop).
If it's looping and you set it exactly to getDuration, it's going to warp back to 0. (i.e. if the animation lasts 3 seconds, then it's going to be 0, 1, 2.... 2.999999.... 0, 1, 2.... 2.999999 and so on)
If not looping, it's going to stick to maximum duration.
If you want it to loop, probably the best is to substract a tiny amount like you're doing right now, e.g. m_pSK->setTime(m_pSK->getDuration()-0.0001);
You could alternatively disable looping, set the duration, then enable looping again:
Code: Select all
m_pSK->setLoop( false );
m_pSK->setTime( m_pSK->getDuration() );
m_pSK->setLoop( true );