# Automatic weapon recoil with that "Counter Strike"-feel

How would you do it?

I already found this function for an impulse (helped by math.SE). It works for single shots, but not for automatic weapons.

Any ideas?

• a similar question was posted [here][1]. [1]: gamedev.stackexchange.com/questions/7276/… Commented Mar 16, 2012 at 17:23
• I know, bit it doesn't give much clues. Commented Mar 16, 2012 at 17:29

Just combine the individual shots' impulses? Something like this:

You could of course add realism:

Particularly when firing on automatic, humans have a tendency to get used to the recoil. Basically, there is some factor that decreases the recoil impulse down to some point. The first shot recoils hard and the following shots add to the kick, but each with decreasing force, until some saturation in the soldier's capability for holding the gun steady is reached. This could be done with a function that modulates that impulse function based on the time since the last shot and the number of shots taken in the same chain of automatic fire.

A slight random factor is also always present in reality.

• "Just sum up the individual shots' impulses?" : nope, I already tested it, and it's awful, for the following simple reason: the time the camera angle takes to return to the original position, is the same if you shoot 1 or 10 bullets. I have to "stretch" time to make the fall back take more time. Quite simple actually: create some factor and multiply the time I add to my time buffer by this factor, this way I "stretch time". But it's tricky, because I have several time buffers, so which one do I apply the factor on ? I guess all of them. Commented Mar 15, 2012 at 18:05
• @joko I added a doodle to better show what I meant. I don't know see what you mean with the "time stretch"... Surely it would be realistic for the gun to return to the same position just as quickly regardless of how many bullets were fired?
– Anko
Commented Mar 15, 2012 at 22:18
• this is not the counter strike feel, because it caps to same maximum angle if you shoot 1 or many bullets. But I could apply a multiplier Commented Mar 16, 2012 at 8:09

well basically, just have some kind of (semi-randomized) rotation that will cause the gun to jerk in an upward direction, and just apply it for every shot