I made a script that can give me the angle of the mouse arround the Center Value
--[[ 90 | 380 -- Center -- 180 | 270 --]]
But i dont know how i can get the Scale of the Center Position it is only getting the Offset of the Position.
Center = Vector2.new(UDim2.new(0.5,0,0.5,0)) -- idk what i am doing anymore -- calculation to obtain the angle that is just getting the offset Angle = (math.atan2(MousePos.y-Center.X, MousePos.x-Center.Y)*180 / math.pi)+180;
UDim2 is merely a way to tell guis to reach a proper size. It does nothing here.
I recommend using half of the screen size, which you can get in cameras.
To get the proper angle you should subtract identical axises; ur very close. Also there is a builtin degrees function use that.
Lastly I don't recommend pascaling every variable like that but w/e. enjoy!!
local mouse = game.Players.LocalPlayer:GetMouse() local center = workspace.CurrentCamera.ViewportSize/2 local angle = math.deg( math.atan2(mouse.Y-center.y, mouse.X-center.x) ) + 180 print(angle)