Essentially I'm trying to get the orientation of the camera (like how parts have an orientation property), but I don't see the camera having that.
I can get the camera CFrame with game.Workspace.CurrentCamera.CFrame, but I'm not sure how to find what the rotation vector is out of this cframe.
CFrame
s have a LookVector
, RightVector
, and UpVector
properties which are the components that describes the CFrame
s orientation using unit vectors.
But if you were looking for angles (in radians) toEulerAnglesXYZ
is a method of CFrame
that returns those angles as a tuple:
local x, y, z = cf:toEulerAnglesXYZ() -- in radians
It could then be used in CFrame.Angles
CFrame.new(0, 0, 0) * CFrame.Angles(x, y, z) -- create another CFrame with a position of 0, 0, 0 -- and the same rotation as cf