Custom camera lagging behind - Looking for smooth turning but precise displacement

I’m trying to make a custom camera where the camera would turn smoothly along with the cursor if the player moves their mouse. I achieved that goal, yet the displacement of the camera is a bit chopped and is lagging behind the actual part.

Here’s a video demonstration:

As you can see, the camera’s movement lags a lot and is chopped. The last few seconds of the video is where the camera needs to be.

Resources.Services.RS.RenderStepped:Connect(function()


Resources.Map.SnowPlough.WiperL:PivotTo(Resources.Map.SnowPlough.WLAnchor:GetPivot() Resources.Map.SnowPlough.WiperL.Angle.Value)
Resources.Map.SnowPlough.WiperR:PivotTo(Resources.Map.SnowPlough.WRAnchor:GetPivot()  Resources.Map.SnowPlough.WiperR.Angle.Value)		Resources.Map.SnowPlough:PivotTo(Resources.Map.SnowPlough.PosAndAng.Value)
				
local NoiseX = math.noise((tick() - TimeNow) / 20 * 75) * 0.5
local NoiseY = math.noise((tick() - TimeNow) / 20 * 100) * 0.75
local NoiseZ = math.noise((tick() - TimeNow) / 20 * 25) * 0.25

local MX = (-0.5 + Resources.Mouse.X / Resources.Mouse.ViewSizeX)
local MY = (-0.5 + Resources.Mouse.Y / Resources.Mouse.ViewSizeY)

Resources.Services.TS:Create(Resources.Camera, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = 

	Resources.CPart.CFrame * (
	CFrame.Angles(math.rad((-50 * MY) + (NoiseX * 1)), math.rad((-150 * MX) + (NoiseY * 1)),  math.rad(NoiseZ * 10)) *
	CFrame.new(NoiseX, NoiseY, NoiseZ))

}):Play()


end)

Any help is appreciated! Thanks in advance

1 Like

Try adding a wait to the loop to not make it update so often. (I know this sounds weird but it should make it less choppy)

1 Like

try making the tween linear. also this looks awesome. (Also, it might be one of the values being too high and making the camera go behind the head).

2 Likes

Thank you! I’ll try making the tween linear.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.