Help with Turret System

Hi there, how would I go about making a turret that smoothly rotates to the mouse position?

(I created a turret in the past using a BodyGyro, but that causes problems when the character is connected to the turret via a seat…)

Here’s a video for reference of what I mean:

Any help is appreciated, thanks.

Using Mouse.Hit, in full you’d want something like this

local mouse = game:GetService("Players").LocalPlayer:GetMouse()
while task.wait() do
    Turret.CFrame = CFrame.lookAt(Turret.Position, mouse.Hit.Position)
end

If I told the turret to look at the CFrame it would appear to lag, how would I make it smoothly adjust to the mouse position?

since while task.wait() do is such a high refresh rate, and this is on the client, it should not look laggy.

I don’t mean actual lag. I want the turret to smoothly adjust itself to the mouse position, I don’t want it to skip instantly to where the mouse is.

I intend for this to be on the server.

Then you want to introduce lag, or a maximum rotation velocity. Maybe AlignOrientation would be useful but I’m not sure how you would get that to track the mouse. Bonus it should be easily repeatable for the server to client and not look laggy like a CFrame loop would look from server to client.