Click-to-move in Godot 3.0 [SOLVED]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GunPoint

So i want to make a strategy game like starcraft.
When clicking somewhere on the screen, the player should move to that location.
Because move_to() was removed, i can’t imagine how i can create a click-to-move system.
I tried

if Input.is_action_pressed("left_click"): //made an input map for left_click
   move_and_slide(get_global_mouse_position())

but the player can move in just one direction
Help

Found the answer myself, i downloaded the pathfinding demo which showed me what i needed

GunPoint | 2018-02-02 12:37

In case it serves to someone, can be subtracted the mouse’s position with the character’s position, like this:

if Input.is_action_pressed("left_click"): //made an input map for left_click
 move_and_slide(get_global_mouse_position() - position)

rjoshua | 2018-02-02 15:03

:bust_in_silhouette: Reply From: talupoeg

You can find this one in official documentation page: