How to make an object follows the player, but only in X position, never in Y?

It’s a platform game and I need my enemy to follow the player, but only in left and right.

I tried to use forces, but the options “Add a force to move toward an object” and “Add a force to move toward a position” impose the object also to follow the player’s Y position.

Could someone please help me?

Use the object Y position and the target X position