I have a point graph that is updated at runtime each time a new cube is placed in a strict 3D grid. The game starts with no points and they are added and the graph updated as the player places cubes. I am having two main issues:
- Local updates just won’t work. I tried everything, the bounding box is correct. It just won’t update. The code is the following in my GraphUpdater class:
public void UpdateLocal(Bounds bounds, int nGraph)
{
var guo = new GraphUpdateObject(bounds);
guo.nnConstraint.graphMask = 1 << nGraph;
AstarPath.active.UpdateGraphs(guo);
}
When the cube is created I pass some bounds around it and the graph number (in this case 1 since I have two graphs).
- I recently switched my project from built-in to URP and a suddenly I have massive lag spikes when I place a new cube and update the whole point graph (I have to update the whole graph since local updates won’t work, but in built-in it was never an issue). Here is the profiler:
There seems to be a lot of GC allocation for reasons I can’t fathom. These spikes come even if I place a single cube (so, effectively the first only node in the scene) and do not scale with the number of nodes.