Help debug why PhysicsAggregate with BABYLON.PhysicsShapeType.MESH isn't initiated Nextjs

Hello, I have a project in Next.js with HavokPlugin where there is a ground/platform and on top of it there are some spheres that move.

For Cylinder, Box platform (CreateCylinder, CreateBox) everything works fine sphere’s physicsBody and ground physicsBody are generated (through PhysicsAggregate) and the spheres don’t pass through ground but stay on top of it. (I can see PhysicsBody by enabling Viewer ShowBody

But if I try to create a Mesh and create a PhysicsBody of MESH type for ground/platform spheres pass through the ground and I can’t see the “body” of ground using Viewer.showBody(ground.body). Same when I CreateCylinder for ground if on PhysicsAggregate function I add BABYLON.PhysicsShapeType.Cylinder works fine and I can see PhysicsBody but if I use BABYLON.PhysicsShapeType.MESH it doesn’t work PhysicsBody for ground isn’t initiated/added

In Playground it works as expected

On nextJS project I have to add Havok like this

  import HavokPhysics from "@babylonjs/havok";
  import { HavokPlugin } from "@babylonjs/core/Physics/v2/Plugins/havokPlugin";
  // ...
  // initialize plugin
  const havokInstance = await HavokPhysics();
  // pass the engine to the plugin
  const hk = new HavokPlugin(true, havokInstance);
  scene.enablePhysics(new Vector3(0, -gravity, 0), hk);

Any help on how to debug this :confused:

Thanks in advance

Apparentely the problem was That I was using both BABYLON object ( from “babylonjs” ^7.13.1) library and Objects like MeshBuilder from “@babylonjs/core” ^7.13.1 library.

2 Likes