Flying around when i start aiming

Hello, I have a problem where i start flying around when i start aiming, and getting flinged when i do stop aiming. Here’s my code:

		RunService:BindToRenderStep("CamAimPos", 1, function()
			local camCF, torsoCF
			local rightShoulder = Torso:WaitForChild("Right Shoulder")
			local leftShoulder = Torso:WaitForChild("Left Shoulder")
			local lerpSpeed = 0.25
			camCF = Camera.CFrame
			torsoCF = Torso.CFrame
			local rightArmPos = camCF * CFrame.new(1, -1, -0.5)
			rightArmPos = torsoCF:ToObjectSpace(rightArmPos) * CFrame.Angles(0, math.pi / 2, 0)
			rightShoulder.C0 = rightShoulder.C0:Lerp(rightArmPos, lerpSpeed)
			local leftArmPos = camCF * CFrame.new(-1, -1, -0.5)
			leftArmPos = torsoCF:ToObjectSpace(leftArmPos) * CFrame.Angles(0, -math.pi / 2, 0)
			leftShoulder.C0 = leftShoulder.C0:Lerp(leftArmPos, lerpSpeed)
			if Tool and Tool:FindFirstChild("Handle") then
				Tool.Handle.CFrame = camCF * CFrame.new(0, 0, -1)
			end
		end)
2 Likes

If no one else knows, I will also add this line of code that was added before the bind:

		Camera.CameraType = Enum.CameraType.Follow
		Camera.CameraSubject = Tool.AimPos
1 Like

Make sure your tool is not collideable

1 Like

Do you have a tool in your hands? All tool parts need to be Massless true otherwise the mass interferes with player physics.

1 Like

tried this and didnt work, well i could just use animations but its really hard and i have to adjust it so much

^^^ do this, your tool is probably colliding with the player character model

There are plenty of posts on the forums about ‘aiming gun to mouse’ or ‘point arm to mouse’.
Maybe search around in a few of those for some hints on what to do.

i also did that but didnt even work.