I want my camera to rotate to follow this moving block, but it’s off centered
local maxTilt = 50
RUN_SERVICE.RenderStepped:Connect(function()
local x = math.rad((((-mainObj.Position.Z - MOUSE.ViewSizeY / 2) / MOUSE.ViewSizeY)) * -maxTilt)
local y = math.rad((((-mainObj.Position.X - MOUSE.ViewSizeX / 2) / MOUSE.ViewSizeX)) * -maxTilt)
local z = 0
CUR_CAM.CFrame = MAP:WaitForChild("GameCam").CFrame * CFrame.Angles(x, y, z)
end)