How do I make one face of a part face toward the camera?

Basically I have a script that makes a flat and square part between two other parts but how would I rotate the flat and square part along one axis until it faces the camera, like this:
weird diagram

I have tried to make it face the camera by making the CFrame of the part CFrame.new(part.Position, camera.Position) but that makes it look at the camera on all axis, I just want it to do it on one.

Sorry if this is not well explained, I can answer any questions needed

Perhaps instead of using camera.Position, make your own Vector3, with the 2 axis you don’t want to be facing the camera be the part’s position and the axis you want to face be the camera’s position

Example, say you want to follow the camera on the Z axis, you could try

local look = Vector3.new(part.Position.X, part.Position.Y, camera.Position.Z)

CFrame.lookAt(part.Position, look)

However, if that doesn’t work you could try out a solution to a problem similar to yours

CFrame.lookAt(Part.Position, Camera.Position)

Part.Rotation = Vector3.new(0, 0, Part.Rotation.Z)
-- Assuming you want it to rotate on the Z axis.