Hi,
i'm just developping a little multiplayer first person shooter for a school project.
And the aim is of course to release something realistic. So I would like to know how can I control the MD2 animation: when my model receive a bullet (collisions with bullet are OK), I have to use "PAIN" animation where we can see the model move as it receive a bullet. But after, it continue to play this anim, so I would like to know how play this anim (this works) and come back to the "stand" or "run" anim when the "pain" anim is finished. An idea ?
Management of MD2 animation
Thanks for this link but it's not the same problem, I would like to play the anim and change when this anim is finished: when my model receive a projectile my collision manager launch the "pain animation" (it shows the model "hurt"), but this animation is looping. So I just shoot one time on it but it continue tu show the pain animation what is not logical and so realistic...
So what I would like is:
- I shoot the model (OK)
- The collision manager detect the collision between my bullet and the model (OK)
- It launch the pain animation to show that the player has been touched (OK)
- It comes back to the stand animation when the pain animation is finished
So maybe I have to try to detect when the last frame of the anim is play but how?
Or another idea?[/u]
So what I would like is:
- I shoot the model (OK)
- The collision manager detect the collision between my bullet and the model (OK)
- It launch the pain animation to show that the player has been touched (OK)
- It comes back to the stand animation when the pain animation is finished
So maybe I have to try to detect when the last frame of the anim is play but how?
Or another idea?[/u]
You must know each frame of your animation. It's up to you how many frames will be played when your model hitted by bullet. Then you should switch animation to "stand".
But if you like you can modify the engine source a little to get non-looping animations. Look there http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2511
But if you like you can modify the engine source a little to get non-looping animations. Look there http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2511