Unity Script Reference:
RigidbodyConstraints.FreezeRotationX
Description

Freeze rotation along the X-axis.