Viewmodel ADS problem

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want to make smooth ADS but without using lerp because that ruins viewmodel

  2. What is the issue?
    Whenever I intend on using lerp function to make my ADS a bit smoother, the viewmodel has some “delay” too and it has little jitter on small movement like rotating camera

  3. What solutions have you tried so far?
    I’ve tried looking in devForum, but didn’t find anything that could fix my problem…

This is my current script —

game:GetService("RunService").RenderStepped:Connect(function()
		if System.ViewmodelEnabled then
			local Rotation = workspace.CurrentCamera.CFrame:ToObjectSpace(LastCameraCFrame)
			local X,Y,Z = Rotation:ToOrientation()
			SwayCFrame = SwayCFrame:Lerp(CFrame.Angles(math.sin(X) * SwayEffect, math.sin(Y) * SwayEffect, 0), 0.1)
			LastCameraCFrame = workspace.CurrentCamera.CFrame

			if arms.PrimaryPart then
				if not aiming then
					arms.HumanoidRootPart.CFrame = cam.CFrame * SwayCFrame * CFrame.new(0,0,0)
					tweenService:Create(cam, TweenInfo.new(.05, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {FieldOfView = 70}):Play()
				elseif not reloading and aiming then
					aimingPart.CFrame = aimingPart.CFrame:Lerp(cam.CFrame * SwayCFrame * CFrame.new(0,0,0), 0.5)
					tweenService:Create(cam, TweenInfo.new(.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {FieldOfView = 50}):Play()
				end
				
				
			end
		end
	end)
1 Like