Found a solution!
I played around with it until it started working, but then it would only do right turns on some turns and not others, so I added an if statement to stop a connection if it was a diagonal.
Here's the code if anyone is using the tutorial and wants more grid-like movement.
func _ready():
astar = AStar.new()
var cells = gridmap.get_used_cells()
for cell in cells:
var ind = astar.get_available_point_id()
astar.add_point(ind, gridmap.map_to_world(cell.x, cell.y, cell.z))
all_points[v3_to_index(cell)] = ind
for cell in cells:
for x in [0, 1]:
for y in [-1, 0, 1]:
for z in [0, -1]:
var v3 = Vector3(x, y, z)
if v3 == Vector3(0, 0, 0):
continue
if v3 == Vector3(1, y, -1):
continue
print(cell, " ", (cell + v3), " v3: ", v3)
if v3_to_index(v3 + cell) in all_points:
var ind1 = all_points[v3_to_index(cell)]
var ind2 = all_points[v3_to_index(cell + v3)]
if !astar.are_points_connected(ind1, ind2):
astar.connect_points(ind1, ind2, true)