How do I make an enemy with AI that only moves on the x axis?

Just started dabbling with A* and im trying to figure out a way that the enemy acts so he is standing on the ground and cannot draw waypoints above and just start floating.


This requires a custom movement script.
The built-in movement scripts all assume movement in a plane.