Help with :ToEulerAnglesXYZ() (PLEASE FOR THE LOVE OF GOD HELP ME FIX THIS)

I am so confused rn

so I have this script that gets the camera orientation:

local camera = workspace.CurrentCamera

local X, Y, Z = camera.CFrame:ToEulerAnglesXYZ()
print(math.deg(X))

and when it runs it gives me a value that seems totally random
i.e.
here is the value: -150.32556514091894

and here is the properties of the camera:
(as you see NONE of these match the value number)
image

1 Like

nvm found a solution on hiddendevs

1 Like

Well first of all Angles are in radians and .Orientation uses degrees so you need to convert from radians to degrees you can do that by replacing “math.deg(X)” by “Vector3.new(math.deg(X),math.deg(Y),math.deg(Z)” and also if you want to constantly check for the camera’s orientation (so not just get the values in one specific time) you have to put the variable “local X,Y,Z” in a loop or else its going to give you only the first camera orientation values.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.