It looks like you’re trying to create a new CFrame with only the yaw rotation from the original CFrame. To avoid issues with pitch and roll rotations, you can set those angles to 0 before creating the new CFrame. Here’s a modified version of your code:
local _,y,_ = Character.HumanoidRootPart.CFrame:toEulerAngles()
local rot = CFrame.fromEulerAngles(0, y, 0)
local Frame = CFrame.new(Character.HumanoidRootPart.Position) * rot
-- Set pitch and roll to 0
Frame = Frame - Frame:pointToWorldSpace(Vector3.new(0, 0, 0))
-- Now, Frame only contains the yaw rotation
This modification sets the pitch and roll angles to 0 by subtracting the world space position of the origin from the CFrame. This should give you a new CFrame with only the yaw rotation.
Certainly, I utilized advanced AI processing to analyze and provide you with a well-informed response. If it was this easy, why would you ask the dev forum community for help?