How would i make my mouse move around my character, based on the mouse position?

Hi DevForum!

I can’t find any good articles or posts on the forum on how to make a camera system like this:

Basically i want the camera to rotate when i mouse my mouse.
How would i achieve this?

(EDIT: Sorry for the laggy video, i don’t know why it is like that…)

Thanks in advance!

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera
local rs = game:GetService("RunService")
local ts = game:GetService("TweenService")

rs.RenderStepped:Connect(function()
	local tween = ts:Create(camera, TweenInfo.new(1), {["CFrame"] = CFrame.new(hrp.Position, mouse.Hit.p) * CFrame.new(0, 0, -10)})
	tween:Play()
end)

This is a little too choppy though.

Yeah, it’s not exactly what i was aiming for.