Godot Version
4.3
Question
for reference, I am following this tutorial(modified to not use a gridmap): https://www.youtube.com/watch?v=zLIxn5W1Ibg&t=605s
class_name Pathfinder
var astar : AStar3D = null
var navigation_points = []
var indicies = {}
func new_init(transcriber) -> void:
self.astar = AStar3D.new()
for cell in transcriber.corridors:
var point = Vector3(cell.transform.origin.x, cell.transform.origin.y, cell.transform.origin.z)
navigation_points.append(point)
var index = indicies.size()
indicies[point] = index
astar.add_point(index,point)
for point in navigation_points:
var index = get_point_index(point)
var relative_points = PackedVector3Array([
Vector3(point.x+2, point.y, point.z),
Vector3(point.x-2, point.y, point.z),
Vector3(point.x, point.y, point.z+2),
Vector3(point.x, point.y, point.z-2),
])
for relative_point in relative_points:
var relative_index = get_point_index(relative_point)
if relative_index == null:
continue
if astar.has_point(relative_index):
astar.connect_points(index, relative_index)
func find_path(start, target):
var astar_path = astar.get_point_path(get_point_index(start),get_point_index(target))
return astar_path
func get_point_index(vector):
if indicies.has(vector):
return indicies[vector]
else:
null```
I get the error "invalid type of function 'get_point_path' in base 'AStar'. Cannot convert arguement 1 from nil to int."
I have verified that both start and target are valid points, as shown in the following screenshot

The other weird thing about this is that I run the get_point_index() function over 20,000 times in the new_init() function, and it returns the correct answer every time