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)