Im just trying to lerp the shoulder attachments of a character to make it look like the character looks where the player’s camera looks, but the lerping seems very laggy / stutters a lot.
local Cangle = math.clamp(angle, -1, 1);
local goal = nil;
if (tool and tool.RightHand.Value) or RotateArm then
goal = rShoulderC0 * CFrame.fromEulerAnglesYXZ(if RotateArm and not(states.Blocking.Value) then angle*0.8 else Cangle*0.6, 0, 0);
else
goal = rShoulderC0;
end
rShoulder.C0 = rShoulder.C0:Lerp(goal, 0.1);
-- angle is the camera's Y rotation
-- rShoulder.C0 is the attachment and rShoulderC0 is its "default value"
The arms keep moving up and down as if the C0 or the goal are changing, but since it’s linear this shouldn’t happen.
Replacing the lerp with rShoulder.C0 = goal
removes the stutter. I only set the alpha to a small number so the stutter is more visible.
How can I make it transition smoother? Any help is appreciated!