Hello,
I have been following along using Godot 3.1.1 and while I have hit some snags from the differences, this one I cannot seem to figure out.
When I try to run the game it crashes with the error:
Invalid get index ‘0’ (on base: ‘Array’)
and its pointing to the navigate function, specifically this line:
var distance_to_destination = position.distance_to(path[0])
I know this means the array is empty, and I have done some debugging to find that to be the case, however I don’t know why?
I have double and triple checked and everything is identical to yours, I even replaced my script with yours.
I added an IF statement to the process function on the navigate() function like this:
if path.size() != 0:
navigate()
So I could get the game to run. I can print available_destinations and I get the Destination node (correct) and I can print available_destinations.get_children() and get all Position 2D nodes (correct) but printing possible_destinations is just an empty array.
Anyone have ant insight on this?
Thanks!