Hi, I noticed I got an error after trying the latest alpha (40) with the updated recast.js.
I get an error on this line:
const navPlugin = new BABYLON.RecastJSPlugin();
error:
BJS - [15:35:52]: RecastJS is not ready. Please make sure you await Recast() before using the plugin.
Uncaught (in promise) TypeError: this.bjsRECAST.Vec3 is not a constructor
at new RecastJSPlugin (babylon.max.js:177643)
Not sure what changed and how to fix it? This ran without problems before…
Provided you load the recast.js script in your HTML:
I had to first wait for the Recast function to complete, so the code needs to be changed to this, wrapped in an async function:
async function buildNav() {
await Recast();
console.log('recast loaded');
const navPlugin = new BABYLON.RecastJSPlugin();
console.log('nav plugin loaded');
}
buildNav();
I’m not sure what the reason is, but for me building the navmesh takes a lot longer than before…
Perhaps yours is still building? Did you try just waiting for a long time to see if it finishes?
Edit: I removed the ‘solved’ flag from my post, since I’d like to wait for Cedric to check if I may have messed something up.
@Censor There should be (almost) no difference in performance. Maybe I missed something with Emscripten. Do you have a PG I can try ? @holger Same, do you have a PG I can check?
So, I can reproduce. Not in a PG but in a local typescript project. I’ve forked and modified @RaananW 's babylonjs-webpack-es6. This is the change: recast init repro · blubberblah/babylonjs-webpack-es6@c1fbd74 · GitHub
Just clone the repo and do a npm install and npm start this should bring up the modified scene src/scenes/defaultWithTexture.ts
As you can see (hopefully), it just hangs forever. I guess I’m doing something fundamentally wrong
I believe there was another thread just started about the error I got (first post).
I’ll wait for the fix and try again, perhaps the issues will be gone and this thread can be closed.
By the way I really like what’s possible with recast and babylonJS