- Home /
Dynamically building multi-floor buildings with navmesh
I am creating a game in which the player is able to dynamically build a structure in-game. However, I'm using Unity's built-in pathfinding engine, and I was wondering if there's a way for me to do this: I want the player to be able to build a structure that has more than one floor. Is this possible using Unity's built-in path finding? If so, how would I build a navmesh for the upper floor? If not, are there any easy solutions? By easy, I mean not impossible to pick up and learn? Thanks in advanced! (Also, preferably give me free solutions, as I am trying to make a free game.)
Answer by incorrect · Jun 15, 2015 at 01:07 AM
As far as I know at the moment you have no way to get access to navmeshes on runtime. They are generated only in Editor and you can not modify them directly. However there are some tricks like Off-Mesh Links, which probably can help you, but I'm not sure if you can LoadLevelAdditiveAsync another scene into yours one with it's own navmesh, connect them with links and it will work. Anyway, feel free to make your own navigation system. Look at A* algorithm for a start. :)
Thanks! And thanks for the quick response! I'll have to check out A*.
Aron Granberg's Astar Pathfinding Project supports assigning navmeshes at runtime and rescanning graphs at will.