local cframe=CFrame.Angles(pitch,0,0)*CFrame.Angles(0,yaw,0)
If I didn’t know what the pitch and yaw were, but I had the complete cframe, how could I figure the pitch and yaw out so I could form a cframe like above?
Doing this because im tryna make a camera system that can be enabled/disabled and can transition from the regular camera. Pitch and yaw are determined directly through the InputChanged event, but I need to find the camera’s original cframe as if it were constructed the same way as my camera system, and I’m not exactly sure how to do that. Any help would be appreciated!
You could alternatively create a CFrame from yaw and pitch by doing, local cf = CFrame.Angles(0, yaw, 0)*CFrame.Angles(pitch, 0, 0)
and make sure yaw is between -math.pi and math.pi
and make sure pitch is between -math.pi/2 and math.pi/2
(This should be easy to visualize too.)
Then from there, cf:toEulerAnglesYXZ() will return back pitch and roll as put in.