Generating graphs at Runtime

I am making a diablo-like game, where I generate dungeons with a tilemap system. Generating the dungeon in the editor, my script updates the A* graph perfectly fine, but at runtime the graph doesn’t update and the enemies are stuck moving on the old graph, going through the walls in the new dungeon.

I call this method on the tilemap object with the walls after I generate a new dungeon, and I use the Async scan to scan the graphs again afterwards. Again, in editor this works completely fine and the graph gets updated to the new dungeon generated, but in game, the graph doesn’t update and enemies are stuck on the old graph. If someone could point me in the right direction I’d be so grateful :slight_smile:
Thank you!


The comment mentions that you change some settings on the guo, do you do that?

Does it work if you delay the update/scan by one frame?