Unity Script Reference:
RigidbodyConstraints.FreezeRotationY
Description

Freeze rotation along the Y-axis.