There are a couple of examples around the Dev Forum and on YouTube.
I’ve slightly rennovated the script.
In a nutshell, MAX_TILT determines the maximal angle a camera may tilt in a direction, and this part calculates tilt percentage according to the mouse’s distance from the edge of the screen (100%): (mousePos.Y - camera.ViewportSize.Y/2) / camera.ViewportSize.Y).
MAX_TILT could also be different for X and Y.
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local MAX_TILT = 10
local camera = workspace.CurrentCamera
local cameraPart = workspace.CameraPart
repeat
task.wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
RunService:BindToRenderStep("MenuCamera", Enum.RenderPriority.Camera.Value +1, function(deltaTime)
local mousePos = UIS:GetMouseLocation()
camera.CFrame = cameraPart.CFrame * CFrame.Angles(
math.rad(((mousePos.Y - camera.ViewportSize.Y/2) / camera.ViewportSize.Y) * -MAX_TILT),
math.rad(((mousePos.X - camera.ViewportSize.X/2) / camera.ViewportSize.X) * -MAX_TILT),
0
)
end)