About Store Forum Documentation Contact



Post Reply 
How do you stop a motion?
Author Message
Aniketos Offline
Member

Post: #1
How do you stop a motion?
How do I end a Motion animation? I tried general_motion.clear(); but it doesn't do anything...

I'm doing something like this code wise:

struct GeneralAnimation : Motion
{
void set(CSkeleton &cskel, Str animation);
};

GeneralAnimation general_motion;

general_motion.set(cskel,"anim/custom/idle.anim");
12-19-2010 05:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: How do you stop a motion?
The way I did it in my game demo was a combination of calling .clear() and a stoppage of calling .updateAuto(). So something like this:

Code:
void Player::animate()
{
    ...
    if (updateAnimation) general_motion.updateAuto(3, 3, Time.speed());
    ...
}

...

general_motion.clear();
updateAnimation = false;

You could also try setting the time to the end of the animation:

Code:
general_motion.time = general_motion.skel_anim->length();
(This post was last modified: 12-19-2010 11:32 PM by Driklyn.)
12-19-2010 11:27 PM
Find all posts by this user Quote this message in a reply
Aniketos Offline
Member

Post: #3
RE: How do you stop a motion?
Thanks got it working smile
12-20-2010 12:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply