Unity Script Reference:
RigidbodyConstraints.FreezeRotation
Description

Freeze rotation along all axes.