Hello,
I'm trying to make a Script that allows me to lock a Camera on a certain Part, and allow me to look around via the Cursor. I'd like it to stay where it is, and only look so far to the right and above, vice-versa. I am really horrible at mathmatics when it comes to using Objects, logic and whatnot. The best attempt I've gotten led my Camera to appear in void, instead of seeing the original Position, with the Baseplate beneath it. What am I doing wrong, how can I do what I want?
local Player = game:GetService("Players").LocalPlayer
local Cursor = Player:GetMouse()
local Camera = workspace.CurrentCamera
Camera.Subject = workspace.CamPart
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CoordinateFrame = workspace.CamPart.CFrame
Cursor.Move:Connect(function()
Camera.CFrame = Cursor.Hit
end)
-- I realized that Hit was the worldspace CFrame of the Cursor, so this was my attempted fix
Camera.CFrame = CFrame.Angles(math.rad(Cursor.X), math.rad(Cursor.Y), 0)
I'm unavailable to reach the Studio, and I was wondering if my fix would work? If not, how can I do this?
Thanks.

1 comment
I have accomplished this in something I made a while back but it does require knowledge in a few advanced mathematical topics.