AStar solid but in solution still?

Godot Version



I set (0, 1) to solid, but it’s still in the solution:

	var astar_grid =
	astar_grid.region = Rect2i(0, 0, 4, 4)
	astar_grid.set_point_solid(Vector2i(0, 1), true)
	astar_grid.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_NEVER
	print(astar_grid.get_id_path(Vector2i(0, 0), Vector2i(1,2)))


[(0, 0), (0, 1), (1, 1), (1, 2)]

Have I discovered a bug in Godot?

The function update() has this note:

Note: All point data (solidity and weight scale) will be cleared.

So calling update() resets the points that were previously set to solid, if I understand correctly.
Try calling update() first then set a point to solid to test it.

1 Like