Support Forum

AddNode Doesn't Exist?

Hello hello, using A*PP for generating pathfinding for my project where I procedurally generate hexagon terrain. So my thought would be to create a GridGraph from scratch, add my nodes via the data I already have, and then scan.

However, it appears AddNode doesn’t exist on the GridGraph? I was looking at the documentation, and for me it just isn’t there at all, as far as I can tell.

I should also note I am using the Beta 4.3 version, as I was hoping to get the benefits of burst and the like. Does anyone know how I would achieve this? Is there an alternate function or way to do this?

Hi

AddNode doesn’t make sense for a grid graph because a grid graph is always, well, in a grid. Adding a single node doesn’t work.

You might want to check out https://arongranberg.com/astar/docs/runtimegraphs.html
also this method exists in the beta version which might be useful https://www.arongranberg.com/astar/documentation/dev_4_3_41_5623d52b/gridgraph.html#SetGridShape
this might also be relevant: https://www.arongranberg.com/astar/documentation/dev_4_3_41_5623d52b/gridgraph.html#inspectorHexagonSizeMode