A* Pathfinding Project

Auto generate nav mesh diffrent at start of level than when scanned


First off I would like to say thanks for the package! We used A* on the recently shipped Void Bastards and really enjoyed working with it. I’m looking forward to learn more about all the things that have been updated in the last few years!

In our new game we are experimenting with generated levels and would like A* to create the nav mesh automatically. (On Void Bastards we had a cache for every level).

Today I noticed that the nav mesh generated when the level loads is different to the nav mesh generated when you use the Scan button on the bottom of the inspector.

It’s a little hard to see in these screenshots, but the ground is a flat plane with some barrel shaped obstacles. When the level starts, the nav mesh is raised up around the obstacles, but after you run a scan, its flat on the ground as expected.

What’s different about the mesh that is created automatically on level load and the one created when you scan? Can we improve the automatic nav mesh some how?



There is absolutely nothing in the code that distinguishes the level generation when the level starts from when it is done in the editor. So there must be something in your scene that changes I think.
Are you sure there are no colliders or anything that are placed or removed when the game starts?


Thanks Aron, I don’t think anything is changing with those objects.

I will try and get a solid reproduction of what is going on and I will get back to you and let you know what the problem is.


I’m fairly sure that this problem is because we were generating the nav mesh based on the mesh geometry rather than collision, and we do have some meshes that are destroyed on awake. (I had assumed they would be ignored because they did not have collision.)