How to rotate a frame based on camera orientation?

How would I get the camera orientation?
I have this code, but it doesn’t work the way I want to.

local camera = workspace.CurrentCamera
local frame = script.Parent


while wait() do
	
	frame.Parent.Rotation = camera.CFrame:ToEulerAnglesXYZ()
	
end

So basically I want the frame to rotate based on the camera’s rotation.Y

You could get the Camera’s lookVector using camera.CFrame.LookVector, then add the position of the part to shift the look vector relative to the part, then make the part look at the lookVector


^ Just an idea I havent tested it yet

didn’t work, sorry

30303030303030

CFrame:ToEulerAnglesXYZ() returns the angle measures in radians. You can convert a radian angle to degrees using math.deg(angle).

It almost works, but the rotation is weird.