Gun cframing looks extremely choppy

Hi guys when I set the motor6D C0 for each rendered frame it still gets kind of choppy


code;

game:GetService('RunService').RenderStepped:Connect(function()
	local XVector,YVector = math.asin(workspace.CurrentCamera.CFrame.LookVector.X),math.asin(workspace.CurrentCamera.CFrame.LookVector.Y)
	Gun.Support.Rotate.C0 = Offset * CFrame.Angles(0,XVector,-YVector)
end)

I do not advise you use cframe when it comes to guns. It is better to just animate it.

1 Like

You can try using CFrame:Lerp() for smoother movement.

game:GetService('RunService').RenderStepped:Connect(function()
	local XVector,YVector = math.asin(workspace.CurrentCamera.CFrame.LookVector.X),math.asin(workspace.CurrentCamera.CFrame.LookVector.Y)
	Gun.Support.Rotate.C0 = Gun.Support.Rotate.C0:Lerp(Offset * CFrame.Angles(0,XVector,-YVector), 0.1)
	--You can change the 0.1 at the end to any number from 0 (exclusive) to 1 (inclusive)
	--Think of it as a percentage. 0.5 = 50%, 0.25 = 25%, etc.
end)

I tried to use tweenservice and its choppy

What if you replace .RenderStepped with .HeartBeat, since it is the fastest posible in the game.

Also in the :GetService you need to put " and not ’

game:GetService("RunService").HeartBeat:Connect(function()

it’s still choppy with .Heartbeat and " makes no difference than ’

What if you try welding the gun to the players hand instead? Then animate it’s equipped and unequipped stage’s with twee service while removing and adding the welds.

I mean it could be, but it was a gun for like vehicles
like a M60 mounted on a vehicle
That’s why it’s like that :stuck_out_tongue:

1 Like