Change a model CFrame with the camera Pitch and Yaw?

Hey,

I’m trying to set the CFrame of a model to the camera orientation and make sure it only change the Y orientation.
But the results are really bad and it doesnt match the camera orientation, here is the code and a preview.

robloxapp-20220206-1422323.wmv (1.1 MB)

local Angle = Vector3.new(CameraCF:ToEulerAnglesXYZ())

local PitchCFrame:CFrame = Pitch:GetPrimaryPartCFrame()
local X,Y,Z = PitchCFrame:ToEulerAnglesXYZ()
Pitch:SetPrimaryPartCFrame(CFrame.new(StartPitchCFrame.Position) * CFrame.fromEulerAnglesXYZ(X,Angle.Z,Z))

Also, is there a way to get the “Orientation” of the camera like if I did Part.Orientation ?

If someone can help I would love it, thanks.

Can try something like this:

local modelPosition = theModel:GetPivot().Position
local pitch, yaw, _ = camera.CFrame:ToEulerAnglesYXZ()    -- using YXZ not XYZ
theModel:PivotTo(
			CFrame.new(modelPosition) * 
			CFrame.Angles(0, yaw, 0) * 
			CFrame.Angles(pitch, 0, 0)
		)

-- or just
theModel:PivotTo(CFrame.new(modelPosition) * camera.CFrame.Rotation)