Hello everyone,
I’m developing a solo FPS combat game. When my character dies, I apply an add impulse, making sure it acts from the direction of the bullet’s trajectory.
I apply this when my character falls to the ground and dies. I like how it works. However, when I fire in rapid succession, my character gets dragged along the ground. How can I stop this?
There are three possible methods to avoid this I can think at this time:
Apply cooldown after each shot received:
You can turn off the physics/collisions for a brief period of time after a shot is received, avoiding to accumulate impulse.
Turn off the phsycis/collisions completely after applying the first impulse:
You can turn it off completely, avoiding more interactions with the body.
Reduce impulse or increase mass:
You could reduce the impulse applied after the first one, so the movement won’t be so exagerated. You can achieve the same result by increasing the mass of the body at that same moment.
My fav would be the second one if you don’t need to interact a lot with the boddies, as that option is the mos performant. But if you want to maintain the interaction with the boddies, I’d rather go with the third one.
You can test all of them anyways and choose your favorite!
Let me know if this helps you or if you need more help!