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?

not yet, still struggling, kinda sucks

Could you supply a video of the shaking? or a rbxl file of a demo so we can have the exact setup as you?

1 Like

i returned to roblox studio after long time, responding to the messsage 11 months later, it made me look back at the issue and realize why was it caused because of a funny bug that sent me to 0,0,0 and i noticed that the shaking stopped,

> it was because i was around 15k studs away from 0,0,0, when i moved the entire map to 0,0,0 then the shaking problem was solved easily

1 Like

Yep that’ll do it! Anything past 5k studs gets really wonky tbh, try and stay below that and use optical illusions instead if you want bigger maps.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.