Lerping while playing an animation causes player to shake

  1. What do you want to achieve? Keep it simple and clear!
    I want to make an aiming system that uses AimParts, but it causes the player to shake

  2. What is the issue? Include screenshots / videos if possible!
    Video:

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have searched the DevForum, but i got nothing related to my problem.

My script:

Tool.Equipped:Connect(function()
	while Tool.Parent == Character do
		if AimDown == true then
			Tool.AimPart.CFrame = Tool.AimPart.CFrame:Lerp(Character.HumanoidRootPart.CFrame, 1)
		end
		wait()
	end
end)
1 Like

I’m not 100% this will work but give it a try

	while Tool.Parent == Character do
		if AimDown == true then
			Tool.AimPart.CFrame = Tool.AimPart.CFrame:Lerp(Character.HumanoidRootPart.CFrame, 1)
            AimDown = false
       end
       if not AimDown then
         AimDown = true
      end
   end
end)

That makes the player shake even when it’s not aiming.

Also I’m using FE gun kit

please turn collide off if it’s like that

the gun is unanchored

Try turning off the collision on the gun, while lerping your hitting the gun on the ground. So that’s why you shake.

Oh, so that’s why it was happening. When you continuously set cframe while it’s unanchored, the velocity on the fake arms keeps going up until it gets so high that it the script can’t update the cframe fast enough. Just simply anchor the root part and unanchor the other parts. Another thing to point out is, there isn’t any point using lerp method if you are setting the alpha as 1.