Adding gun recoil physics on a free object

Hello,

I want to make an object shoot a projectile on the ground just like a gun.

The projectile’s impact should cause the object to push away from the ground (similar to a quake where it shoots on the ground and jumps up).

Is there any online tutorial I could follow?

I am also attaching an image for a better reference.

In Quake I think that what added the impulse was the explosion of the rocket. For this you just need to get the direction vector from the impact (center of explosion) to the player and use that to launch the actor. The closer the actor to the center the larger the force.

If you simply want it to happen on every bullet fired, just get the direction the bullet will go, flip it * (-1) and use that to add impulse / launch.

1 Like