I'm trying to rotate a Model relevant to the Camera, however, the model must be able to roll. I think that when it faces the opposite initial direction, it flips the yaw of the Root (the part being rotated). I can't logically figure out how to control this because I'm not super aware of the math involved. Below is the code I use to rotate the part and I've commented on each chunk of what I understand about what it's doing.
local r = root.CFrame:Inverse() * camera.CFrame --root direction relevant to the camera
local dY = math.atan2(r.X, r.Z) --y difference
root.CFrame = root.CFrame * CFrame.Angles(0, dY, 0) --assigning the root cframe to itself plus the yaw difference to point in the camera's direction
To be precise, I need the part to be facing the camera. If the part's face is away from the camera (happens when rolled), it will not invert the yaw rotation, and still be able to face the in the camera's direction.
I could really use some help with this. Thanks in advanced.

2 comments
the chicken wants to live badly
so its having a seizure, code cant fix the chicken D: