Unity Script Reference:
RigidbodyConstraints.FreezePositionX
Description

Freeze motion along the X-axis.