There are quite a few errors in your code like $Spatial.look_at(Vector3 path[path_ind])
firstly is "Spatial" the name of a child node? Secondly the" Vector3" is not needed, in the first lot of code I was trying to tell you what types go in the brackets, these are called arguments.
examples that would work.
look_at(Vector3(10, 20, 30)) #looks at x-10, y-20, z-30 point
look_at(transform.origin + Vector3.ONE) #looks at the node's position plus 1 on each axis.
Also the code in _physics_process
won't do anything but change the velocity variable. The return value of move_and_slide
doesn't need to be stored as a variable to work.
The look_at()
and xform()
are in _ready
which will only execute once on the first frame, they need to be in _process
or _physics_process
.
Honestly, I'd advise you to look for tutorials on basic coding concepts before taking on navigation. Mainly learn about types, methods and functions and how they work together.