Unity Script Reference:
RigidbodyConstraints.FreezePositionZ
Description

Freeze motion along the Z-axis.