Tilemap loading question

stupid noob question here, but im hoping someone can help me out.

I have a project where im procedurally generating a tilemap, then using the AstarPath.active.Scan(); function to get everything to work. this is the last thing that happens in the script that sets the map up. I then use the proceduralGridMover script to follow my player around as he chases a target.

The issue is the initial area the gridgraph i have never has any nodes attached to it until the proceduralGridMover has moved (this only updates new tiles uncovered, including the originals).

I’m assuming its something simple that im overlooking…

Hi

When are you calling the Scan function? Are you sure it is called after everything has been generated? Try to wait a frame before calling it, sometimes the physics engine does not update things immediately (though it usually does).

I knew it was something silly. I found a bug report that the tilemap collider can sometimes not update properly. so my solution was to turn off the collider in the inspector, then turn it on is the script right before updating the navmesh.

appreciate the help!!!

1 Like