I made a function that takes a angle in radians and sets the orientation of the Camera CFrame’s Y to that value, while preserving everything else. These prints are expected to match.
14:59:09.840 -15.000000417413027 90.00000250447816 0
14:59:09.840 6.482066111907466e-07 90.00000250447816 -15.000000417413027
This is the entirety of the function, angle is in radians:
local cameraCFrame = camera.CFrame
local xRot, _, zRot = cameraCFrame:ToOrientation()
After making an adjustment to change that I am getting a less confusing result, but still a non matching one.
With an intial orientation of -15, 90, 0 when veiwing the cameras cframe of my player and a angle equal to 90 degrees, I am expecting the result to be -15, 180, 0 or -15, -180, 0. Instead I now get:
-90 90 90
0 90 0
This is the updated code
local cameraCFrame = camera.CFrame
local xRot, _, zRot = cameraCFrame:ToEulerAnglesXYZ()
print(math.deg(xRot), math.deg(angle), math.deg(zRot))