- A* version: 5.4.5
- Unity version: 6000.2.6f2
Hi, I’ve just installed the Pro asset to upgrade the inbuilt Unity navigation for improved performance.
I have a 2D game (XY axis aligned) and use several tilemaps for the different terrains (e.g. 1 tilemap for grass + 1 each for sand/snow/water).
I’m really struggling to use the plugin. I don’t see many updated tutorials of how to use a recent version and even something which feels like it should be a single line of code like moving the center of the graph seems incredibly complex (my world is procedurally generated and I only want to generate a specified area around the player from time to time).
I think I worked out the repositioning (at least it seems to mostly work?)
for (int i = 0; i < _astarPath.graphs.Length; i++)
{
RecastGraph currentGraph = _astarPath.graphs[i] as RecastGraph;
currentGraph.forcedBoundsCenter = transform.position;
currentGraph.transform = currentGraph.CalculateTransform();
}
AstarPath.active.Scan();
^ is this right? It seems clunky?
That aside, I have 2 primary problems I can’t figure out and would like to request help with (I’ve already lost ~6hrs struggling with it today):
Problem #1: I cannot get Tilemaps to be used in the scanned graph
This is the big problem I can’t seem to solve no matter what I try.
I have a single Recast Graph for now (2D) and it tends to find the map object colliders (e.g. trees, rocks etc.) well enough. However no matter what I’ve tried, I cannot get it to take the tiles that exist on each of the tilemap layers (separate GameObjects for each terrain type) and make them show up in the generated NavMesh with the proper tags (or at all even without tags).
Here’s the AStarPath component setup (Recast):
And here’s how the tilemaps look (I’ve tried every combination of with TilemapCollider2D, RecastNavmeshModifier and nothing causes it to show up)
Problem #2: Often doesn’t draw the graph in scene view
Very often it will simply stop drawing the graph whatsoever which makes it effectively impossible to know if something I’ve done even works.
Even if I haven’t changed anything since the last run, it will simply stop rendering (even if I use the rescan button and use Solid Colours). Turning random things off and on a bunch of times will sometimes fix it, sometimes not.
Please send help!
Thank you in advance for any help you can provide with this!













