I’ve done this before. It’s really simple once you find a method that works for you, what I did was something among the lines of…
local camera = workspace.CurrentCamera
local viewport = camera.ViewportSize --//Current screen size of player
local mouse = game.Players.LocalPlayer:GetMouse()
local MAX_X_ROTATION = 45
local MAX_Y_ROTATION = 45
game["Run Service"].RenderStepped:Connect(function()
local X_scale = mouse.X / viewport.X
local Y_scale = mouse.Y / viewport.Y
camera.CFrame = CFrame.Angles(math.rad(MAX_Y_ROTATION*Y_scale), math.rad(MAX_X_ROTATION*X_scale), 0)
end)
I probably left some stuff out, and obviously when I set the camera’s CFrame I don’t take into account any position it should be at, but that’s pretty easy to add in. Something similar to this system is what I would use. You might also need to swap MAX_Y_ROTATION for MAX_X_ROTATION, not exactly sure how this’ll look.