I am making a game where small-ish platforms spawn as player gets closer. Each platform could be somewhat complex, but for this example I am using a plane with just few required scripts. Each platform has a collider that is used as a source for the nav mesh. I am using this High Level Nav Mesh API resource to update the nav mesh surface. So, once a new platform spawns I rerun the BuildNavMesh call. Also, once new platform spawns one old one gets deleted. Most of the time I only have two platforms.
So, once i do call BuildNavMesh and player is moving, there is a little hitch in the movement. It is consistent and doesn’t seem to get longer with platform complexity (more colliders to specify non-passable space).
So my questions is:
What is the best way to handle this situation?
A. Do as I do now and rebuild the whole nav mesh each time?
B. Somehow add new data to the existing nav mesh? I am not sure how to do that, it doesn’t seem like you can just add data to the existing NavMeshData. But then I also have to manually delete unused data (things that out of players scope).
C. Use nav mesh links. Spawn new platform and generate a link to the previous platform.
My other question is: Is it reasonable to expect to generate new platforms like this?
I hope this makes sense. Thanks!