Hello,
I developed a huge 3D city that has several buildings with several floors and several offices on each floor of each building. In order for me to set up the Pathfinding and Navigation system in my game, it turns out I have to make all my walls and floors as ‘static objects’ before clicking on “Bake” and make all my objects enabled. If I do this, I have to shut down Unity and rerun Unity because everything will then function at about 1 frame per minute (because of so many objects enabled all at the same time).
So far, I have my game set up to where if my camera is within a certain 3D cubical space (inside a 3D building), only that single floor gets rendered (whatever ‘floor’ the camera is on in whichever building). My object, (called ‘Inner’, which is what the inside of the building should look like on a floor-level basis) virtually enables itself and positions itself to where it LOOKS as if you are standing inside that building and on that particular floor). I also have an ‘upper floor’ and ‘lower floor’ render as well (which are also child objects of ‘Inner’) which is a copy of the ‘current floor’ which is also a child object of ‘Inner’. The ‘current floor’ object is the current floor that the camera is on. As the camera ascends and descends floors, everything LOOKS the same because ‘upper floor’ and ‘lower floor’ are both copies of ‘current floor’ so it LOOKS like you are switching floors because the camera can not see what is actually happening outside of the building (with ‘Inner’ moving up or down 1 unit). IF I had each floor in every building set up even as disabled instantiated objects, it takes me about 5 to 10 minutes to do a single operation in Unity (as it often causes Unity to crash). That is how big my city is.
If the camera is outside of all buildings, my object ‘Inner’ disables itself and only the outsides of all the buildings get rendered. This is a good practical solution for gaining a faster rendering system for huge cities like mine, but what about for pathfinding? What if I would like to duplicate a certain ‘area’ in my game, make copies of the baked path(s) IN that area and duplicate them to multiple areas (for the multiple floors in my buildings), that if my character is on a different floor from the NavMesh, the NavMesh agent will take the stairs (that link up and connect evenly to each and every ‘floor’)? Thank you for any tips.
Sincerely,
Michael S. Lowe