Using navigation mesh extension

How does one go about using the navigation mesh extension? I’m on version Babylon.js v4.1.0-beta.4

Create Navigation Mesh - Babylon.js Documentation Doesn’t mention what file(s) are required, and I don’t see it listed under: GitHub - BabylonJS/Extensions: Extensions for Babylon.js

When I try to use it, I get an error:

Uncaught ReferenceError: Recast is not defined
    at new RecastJSPlugin (babylon4preview.js:135414)
    at new World (world.js:93)

pinging @Cedric

Unfortunately this isn’t documented, but like the physics plugins you’ll need to get the Recast JS file and load it (whether by script tag or importing it and using a bundler).

I just download it from https://preview.babylonjs.com/recast.js which you can see in the playground example.

If you use a script tag it should be ready to go but using something like parcel you’ll need to do this first:

window.Recast = require('./recast.js');
4 Likes

Thank you!