CreateBox with MultiMaterial and Collision error

I create a simple box with MultiMaterial like any example i found.
I activate collision for the box and then it crashed on collision check.

Any example for creating the submeshes goto index 36 but the returned count is only 24.
Without collisions it worked. But with collisions it crashed.
What is wrong?

Example: ceva | Babylon.js Playground (

Welcome aboard!

Some vertices are reused in several triangles, that’s why the count is not 12 (triangles)*3 (vertex per triangle)=36.

I think you want the vertexStart to be 0 for all sub meshes and you should not push to box.subMeshes: new BABYLON.SubMesh(..., box) is already pushing into the subMeshes array.

Thank you! That solved my problem!