I cannot freeze both position on one axis together with rotation

Hello im creating a physics system in similarity of the penumbra/amnesia style (this means using the mouse to drag objects like boxes, and open doors with mousedrag.) When i drag heavy objects i only want to be able to drag it across the floor (because its heavy) so im trying to freeze both the Y-position and total rotation at the same time only enabling X and Z movement. Thing is when im using this lines of code at the same time, neither the position or rotation freeze work (they do separately though), can annyone enlighten me on whats going on here?

Lines of code:

rigid.constraints = RigidbodyConstraints.FreezePositionY;
rigid.constraints = RigidbodyConstraints.FreezeRotation;


Do like this instead:

rigid.constraints = RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezeRotation;

This^ is called a bitwise operation.