How to make realistic gun holding physics in a FPS game?

Hello!
I’m trying to make a FPS game with some realistic physics. Everything was going well until I went in trouble making a good gun holding physic.
I’m using TweenService to achieve what I want, but it’s not looking realistic.
Here’s my code:

while true do
	if Humanoid.MoveDirection.magnitude > 0 then
		if not (TweenNormal.PlaybackState == Enum.PlaybackState.Playing) and not (TweenAim.PlaybackState == Enum.PlaybackState.Playing) then
			TweenService:Create(Joint, TweenInfo.new(0.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, true), { C0 = Joint.C0 + Vector3.new(math.random(-10, 10) / 100, 0.1, 0) }):Play()
			wait(0.5)	
		end
	end
	
	wait()
end

Basically, what I’m doing in this code is to tween the C0 property from the gun joint every time the player walks.
But, as I said, it’s not looking realistic.
Here’s an example of what I’m trying to achieve:

So, do you have any suggestions or ideas to achieve it?
Any help is appreciated, thanks :smiley:

1 Like