Camera Manipulation Y Axis Problem

So I’m having an issue with CFrame Camera manipulation, its attached to a brick facing my menu scene. The problem is that the camera is supposed to follow your mouse whenever you move it, however when I move my mouse up it moves the opposite direction. And if move my mouse down the camera moves up instead. The Z and X axis works perfectly fine but the Y axis doesn’t. I’ve tried switching the values but it just doesn’t work.

Heres the script

local Mouse = game.Players.LocalPlayer:GetMouse()
local Camera = game.Workspace.CurrentCamera

Camera.CameraType = "Scriptable"
local DefaultCFrame = workspace.Part.CFrame
local Scale = 200

function Update()
	Camera.Focus = DefaultCFrame
	local Center = Vector2.new(Camera.ViewportSize.X/2, Camera.ViewportSize.Y/2)
	local MoveVector = Vector3.new((Mouse.Y-Center.Y)/Scale, -(Mouse.X-Center.X)/Scale,- 0)
	Camera.CFrame = DefaultCFrame * CFrame.Angles(math.rad(MoveVector.X), math.rad(MoveVector.Y), math.rad(MoveVector.Z))
end
game:GetService("RunService").RenderStepped:Connect(Update)

i’m unable to even get your script to work in the first place, but inverting on the y axis shouldn’t be too difficult

I mean to setup it you just have a local script in StarterGui and a part in workspace.

Just negative on the Y?

-math.rad(MoveVector.Y)

dont believe that’d work because of the way roblox makes their rotation

Yeah It didn’t work. I don’t know why roblox uses odd rotation

couldnt you find the “middle” point, and if they’re above that point, then subtract ½pi (and if below, add ½pi)

edit: or simply +½pi, then invert, and then -½pi?

Alternatively you could adjust by mouse.X and mouse.Y. Just gotta get the absolute size of the screen and take the ratio of the mouse position to find the direction the camera should be facing.

The middle point is meant for determining the viewport size of Y and X for example if both of them were 0 then the menu would not even show up so Im not sure if it would work or not.

edit: I just realized a mistake in the script one of the values was set to 0 for the Y viewport size but it doesn’t fix the issue it instead fixes the issue where the camera doesn’t work.

by “middle point” i ment one of the middle (blue) lines. if you want to simply invert it, you need your rotations to be in the “red” square, but your rotations are currently in the orange square, to try to put it simply
image
hence, “simply +½pi, then invert, and then -½pi”, which would put the rotations in the “red” square where you could invert it, and then back again in the orange square.

Oh I see. Can I ask where you would put the + and - pi’s? Or is that a dumb question

actually, it was as simple as just writing -math.rad(MoveVector.X), and my “solution” didn’t seem to work, but you would’ve wrote it in the CFrame.Angles

Oh interesting. Im guessing you know why its CFrame angles. But if you don’t I will give you a quick rundown. If it wasn’t wrote in CFrame angles the way I wanted the camera to work would be compromised, it would basically just move it instead of rotating it to the angle where your mouse is.