"fightable"gun recoil?

I was wondering whether there already was a script or something that pushed the players vision/gun upwards while shooting?
I was originally going to try an action actuator with an animation property (which constantly had a value added while firing) however this method can’t be “fightable” as in the player can drag their mouse downwards to counter the recoil.
I’m using the Riyuzakisan mouselook script and was wondering if it could be possible to add recoil to this? maybe constantly adding 0.1 on the x axis to make the character look upwards while shooting?
Any help appreciated, again i’m not experienced with python but i’m trying to learn :stuck_out_tongue:

thanks

EDIT: managed to easily solve by adding a certain rotation to the player head each time a bullet was fired

1 Like

Make an armature for the gun and animate it. Then you can even add some type of reloading animation with it. (if you’re using armature for hands, then just add few bones and skin the gun to them. )

please make a tutorial out of it

Thatimster already made a tutorial for it years ago: https://www.youtube.com/watch?v=b1OI1q5M7uM

1 Like

Hi! and so there are not so many options for how to make or simulate the recoil of a hand weapon - the first is the simplest animation of the weapon and the player model, while the camera is a descendant of the skeleton bone, for example, the head, and the rotation of the model is controlled by performing a skeleton and a dummy, which is the goal for the bone rotation limiter (here I mean turning up or down on the X axis), in this case, you can make a separate animation for the bones of the head, which will simulate the recoil of different weapons. The second method is a little more complicated since it requires the creation of solids to transmit the recoil pulse to them, you also need to create a skeleton as in the first option, but you still need solids with a limiter by the hinge of solids and when a shot occurs, such a solid body receives a reverse pulse from the player’s gaze and the bones responsible for the head, neck, body must turn on the rotation limiter copied from the solid body that received the pulse and immediately turn off the following will happen in this short time - a sharp copy of the rotation of the bones copied from a solid body will be similar to the recoil from a weapon but since it is almost immediately disconnected there will not be a large interval and the player will perceive it as an imitation of recoil