Navcast
Navcast is a project porting Recast, the navmesh generation module of the popular open-source Recast Navigation library, to Luau.
About
This release aims to provide advanced users a starting point to have full control over navigable geometry and agent capabilities. Navcast is not a “batteries included” navmesh generation tool, nor does it provide a pathfinding runtime. You’ll need to write code that interacts with the Navcast module to use it in your own projects, and you’ll need to handle the pathfinding yourself. I’d like to provide a more complete, easy-to-use module in the future, but that will not be any time soon.
In its current state, this module is likely far too slow to use in live games except for in specific circumstances. I would not consider this a game-ready resource. However, if you are able to generate useful static navmesh geometry with it or if you want to use it as a starting point for your own navmesh generation, you may find it useful.
Additional Notes
For the core library code, I only use types that are available in plain Luau (in particular, vector is used instead of Vector3). Maybe this was a mistake, but I thought it’d be nice for the code to be available in any Luau environment.
As of now, there’s no documentation. This is something I’d like to fix eventually. You will have to look around for yourself to figure things out. Plenty of Recast concepts apply to Navcast, so you might be able to get something out of familiarizing yourself with Recast. The demo source code (more info below) may also help get you started.
Demo
A Recast-inspired demo model available that you can drag and drop into existing places. You may have to drag it into StarterPlayerScripts. In the demo UI, try checking the Live Build Tiles option for larger maps. This will generate navmesh tiles around you as you walk around. This option is especially recommended for large maps.
The demo is not perfect. I had to resort to some unpleasant methods to extract walkable geometry from any BasePart that isn’t one of the Part primitives. There’s plenty to refine, but it was good enough for a demo.
Disclaimer
This is a little pet project I’ve been working on for quite a while on my own. Certain things are incomplete, and there’s probably plenty of bugs that I have not yet discovered. I would not recommend using this code in live games unless using static, manually reviewed navmeshes that you have confirmed are correct.
Code
You can get the models and source code here:
