How to setup Ammo KinematicCharacterController

I changed few things in your PG:

  • gravity
  • shape size
  • controller step height
    and more importantly, I’ve added a call to controller.setUseGhostSweepTest and added flags combination to addCollisionObject to support for characters:

CharacterFilter = 32 and DefaultFilter = 1,StaticFilter = 2

https://playground.babylonjs.com/#Q3RVQC#12

From my experience, ammo character controler can be tricky to set up. If your use case can fit with simple sphere rigid body, I’d go for it. You might end up with slightly more code to handle jumps for example but it will be easier to maintain.

3 Likes