How does collisions between PhysicsImpostor types work?

Hi, I am trying to learn Babylonjs for a small game project and I am stuck in physics and collisions.

So

  1. I imported a .glb as a small hill ground made in Blender
  2. I set parent null to imported ground, so I can apply physics
  3. I put a hero in a CreateBox, and applied physics to the box
    So what happens is that the box with the hero falls through the ground but if I move the hero in a CreateSphere ball, it works fine but it acts like a ball.

I want to understand why some types of physics impostors don’t collide with other types and what is the best approach for this to work?

P.S What I am focused on is to make a third-person hero move with waking animation on the ground based on the ground heights or stairs.
All third-person examples I found are on a plain ground I didn’t find any regarding waking on hill, stairs or setting foot step size,

cc @Cedric

Hi @coladeu welcome to the forum

First, I hugely encourage you to use Physics V2 with Havok Babylon.js docs
It has more support, best performance and a more modern API.
For your PG, CannonJS seems to have an issue between box and trimesh. When switching to AmmoJS, things work fine.

Here is some more infos about character controler and physics V2: Character Controller with Physics V2 | by Babylon.js | Medium

Thank you @Cedric! I will try using Havok

1 Like