5 Days Ago
Dynamic NavMesh Obstacles (#1706) Allows to block of certain areas of the navmesh both in editor and at runtime. For this we introduce and expose the concept of **navmesh areas**. Areas can affect navmesh generation and agent behavior/pathing. ### Details - Accomplished by implementing a tile cache that stores an intermediate representation of the navmesh - The intermediate representation can be used to modify & remove areas of the navmesh. - Modifying the intermediate state is magnitudes cheaper than rebuilding the navmesh from scratch. - Static areas are basically free. - Moving areas are a bit more expensive, but you should be able to have at least a couple of dozens of them - The area's shape is defined by a (trigger) collider that can be linked to a nav area component https://files.facepunch.com/lolleko/1b2911b1/sbox-dev_JTOOu8AAeA.png https://files.facepunch.com/lolleko/1b2911b1/sbox-dev_3XdDSxj7Ly.mp4 https://files.facepunch.com/lolleko/1b2511b1/sbox-dev_XBNEUDAPfh.mp4 https://files.facepunch.com/lolleko/1b2111b1/sbox-dev_CQAKEpUbQk.mp4 ### Summary Allows to create a navmesh area, link it to a (trigger) collider & set it to blocking to create an obstacle. In the future we can expand on area functionality: custom tags, local navmesh generation parameters...