stopping FlyStraightAnimator

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
irrlicher
Posts: 9
Joined: Sat Jul 01, 2006 9:27 am

stopping FlyStraightAnimator

Post by irrlicher »

Hi everybody i've a question in my game i want to stop the FlyStraightAnimator when my class's health is less than 0.
I tried many things but it didn't respond.How can i stop it when my health is less than 0??
That's my code but it didn't work:

Code: Select all

if (health<0)
{
anim = smgr->createFlyStraightAnimator(pos,core::vector3df(16000,350,18000), 0, false);
}
anim = smgr->createFlyStraightAnimator(pos,core::vector3df(16000,350,18000), 10000, false);
node->addAnimator(animaml);
anim->drop();
Note:"pos" is node's position;
Thanks in advance!
Do you think 13 year aged children can't make 3d games? :)
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Adding a new animator does not help. Any existing animators need to be removed...

Code: Select all

  if (health < 0)
  {
    // if you have a pointer to the animator
    node->removeAnimator(fly);

    // if you don't have a pointer to it. note that this will remove all animators
    node->removeAnimators();
  }
irrlicher
Posts: 9
Joined: Sat Jul 01, 2006 9:27 am

Post by irrlicher »

That worked now! :) Thanks a lot!!
Do you think 13 year aged children can't make 3d games? :)
Post Reply