move the player towards the mouse in x axis

Godot Version

4.2.2.stable

Question

Hello i try to create a mobile game which is to move the player toward the fingers with the x axis but he move in the 2 axis her's the code :

You can reset the y component of the velocity before you call move_and_slide()

velocity.y = 0