Multi Move graphs

Hey,

In our project we use grid graphs for all of our navigation. Due to the recent addition of level streaming in our project, I had to re bake the navigation graphs for many of our scenes since they were moved.

A way to move all graphs rather than each individually would be highly appreciated.

-Wolf

Hi

Moving the graphs in what way?
Changing the settings for where they are scanned?
Moving the graphs including any scanned nodes?

Let’s say I have 4 graphs in one serialised asset, it would be nice that there was to translate all 4 at the same time.

Moving the graphs without having to rescan would also be a great addition, but I don’t mind re scanning the graphs ( since there might be small changes to scenes I didn’t notice )

Okay.
There are no group movement tools in the inspector at the moment. You could however move them all using a script if that works for you.

It is possible to move them (using a script) without re-scanning them as well.

Something like this

var offset = new Vector(10, 0, 0);
// Required if you are running this from outside of play mode in an editor script
AstarPath.FindAstarPath();

// Iterate through all grid graphs (I think you are using grid graphs at least)
foreach (var graph in AstarPath.active.graphs) {
	var gg = graph as GridGraph;
	if (gg != null) {
		gg.RelocateNodes(gg.center + offset, gg.rotation, gg.nodeSize, gg.aspectRatio, gg.isometricAngle);
	}
}
1 Like