Baking navmesh data

Hi Team,

@Cedric how could I bake navigation mesh data from babylon directly? I have used this approach to get mesh data, if you see in PG line 157, I am getting mesh data as string after 20 seconds:
https://playground.babylonjs.com/#5HKFKL#23

once I have above data, I am loading it and applying like this PG
https://playground.babylonjs.com/#5HKFKL#24
is that correct approach?

I am having another issue here, all agents are gathering on same place instead going to new location, this is also the case without using baked data.

Thanks for any input.

I’m not the best person to know if using a json for a unit8array is the best way. I’m more used with base64encoding.
For the gathering, judging by your code, the random position radius is too small for the size of your world.
I changed it to 1000 and it works better. It needs more tweaking.

Babylon.js Playground

1 Like

Thanks @Cedric
for the gathering I fixed in my scene with radius. Thanks

for unit8array I don’t think btoa/atob are reliable methods, so I will try to use a library for conversion, such as GitHub - enepomnyaschih/byte-base64: base64 utilities for TypeScript and JavaScript.

1 Like