How would I make gun sway like this?

Hello. I’m making an fps system right now however I have been noticing that my sway for huns does not look the most natural. Right now I create a sine and cosine wave and apply them to make sway which looks like this

However I was looking at other games and they seems to have the arms sort of respond to the moving like this

External Media

(this is a streamable link btw the vid is too big for devforum)

anyone know how I could do this? or tell me what to look at to replicate this?

1 Like

I am assuming you take the amount of rotation you did in a frame and apply the sine function based on how much you rotated.

Now, if you wanted to get that you could make it more harsher and make it like (1/x) function to make it harder to make the gun sway more off the screen. You could then add a sway variable to makes it sway off a bit from where you turned the other way. Then you could make it slowly slow down using (x*0.8) or something.