Give the player pathfinding, have an event for when the mouse is clicked to set the pathfinding to that point, then when the path is found make the player walk the path.
But the pathfinding will ignore the wall. I didn't say about these detail, sorry.
The player must receive an impulse and he will only stop if reach the mouse position or some wall.
He need to go in a line.