How to disable movement along a certain axis

This doesn’t work for me. The AI just keep trying to move and rotate on the X (locked) axis.