Disable y,z physics on rigid body

I’m trying to make it so physics for my rigid bodies can only move along the x axis. So if two rigid bodies collide it will just knock the other object on the x axis instead of sending it flying off in different directions. so if a block hits another block they will just keep going on the x axis. Anyway to do this ?

On the gameObject, in the RigidBody component, under constraints, Freeze the Y & Z positions and rotations.

This doesn’t always work. I find a rigidbody passing through another can disturb it’s position and rotation regardless of checking constrain axes in the Rigidbody component dialog.