Viewmodel shaking unintentionally

I noticed that my viewmodel of gun is shaking slightly , i dont know what is causing it but i need it to hold still

I tried removing all additions like sway,walk,etc… but its still shaking

this is my viewmodel script

-- vm is the viewmodel
local function viewmodel()
	eqpspring:shove(Vector3.new(-7,-6,4))
	wait(.07)
	vm.Parent = workspace.CurrentCamera
	game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
		
		
		vm:SetPrimaryPartCFrame(camera.CFrame
			* CFrame.Angles(0,0,strafing.z)
			* CFrame.Angles(WalkCFrame.X,WalkCFrame.Y,WalkCFrame.Z)
			* aimCFrame
			* BreathCFrame
			* CFrame.Angles(jumps.x,jumps.y,jumps.z)
			* CFrame.Angles(0,-SwayCFrame.Position.X,-SwayCFrame.Position.X * 1.2)
			* CFrame.new(-SwayCFrame.Position.X / 1.7,SwayCFrame.Position.Y / 1.7,0)
		)
		if Equipped then
			if Reloading == true then
				gui.Frame.Ammo.Text = "RLD".." / "..tool.Mags.Value
			else
				gui.Frame.Ammo.Text = tool:WaitForChild("Ammo").Value.." / "..tool.Mags.Value
			end
		end
		timeElapsed1+= deltaTime
		if timeElapsed1 < refreshRate1 then return end -- Only update ever X seconds
		timeElapsed1 = 0
		if strafeA == true then
			strafeCFrame = Vector3.new(0,1,0.05)
			velocity =  Vector3.new(0,-player.Character.Humanoid.WalkSpeed*46.2,0)
		elseif strafeD == true then
			strafeCFrame = Vector3.new(0,1,-0.05)
			velocity =  Vector3.new(0,-player.Character.Humanoid.WalkSpeed*46.2,0)
		elseif Walk then
			strafeCFrame = Vector3.new(0,0,0)
			velocity =  Vector3.new(0,-player.Character.Humanoid.WalkSpeed*46.2,0)
		else
			strafeCFrame = Vector3.new(0,0,0)
			velocity = Vector3.new(0,0,0)
			EQuipCfrma = Vector3.new(0,0,0)
		end
	end)
end

any help is appreciated :slight_smile:

1 Like

we both have the same problem, have you found a fix?