It's not quite that straight forward. get_simple_path
returns an array of Vector3s that the AI can follow, so the code needs to go through the array of Vector3 points to direct the AI through, here's an example.
var nav_path
var path_index : int
func _ready():
while true:
yield(get_tree().create_timer(0.2),"timeout")
nav_path = navigation.get_simple_path(from, to, optimize true/false)
path_index = 0
func _process(delta):
move_and_slide(global_transform.basis.xform(Vector3.FORWARD))
look_at(nav_path[path_index])
if global_transform.origin.distance_to(nav_path[path_index].global_transform.origin) < 0.1:
path_index += 1