# Havok physics wlaking character bouncing over heightmap

**URL:** <https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879>\
**Category:** Questions\
**Tags:** heightmap, havok\
**Created:** [June 23, 2023, 4:57pm UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879 "2023-06-23T16:57:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcello\_Fabbiani](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/marcello_fabbiani/32/33022_2.png) [@Marcello\_Fabbiani](https://forum.babylonjs.com/u/Marcello_Fabbiani)\
**Post date:** [June 23, 2023, 4:57pm UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/1 "2023-06-23T16:57:01Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#Z8HTUN%23459)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

the player have a small laggy bouncing, someone could help me to get a stable movement?  
🙂

this is the BG of a player waking over a non heightmap, and the movement is fuild without that laggy bouncing. [https://playground.babylonjs.com/#Z8HTUN#458](https://playground.babylonjs.com/#Z8HTUN#458)

---

<div class="post-metadata">

**Author:** ![alexchuber](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alexchuber/32/52000_2.png) [@alexchuber](https://forum.babylonjs.com/u/alexchuber)\
**Post date:** [June 23, 2023, 11:42pm UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/2 "2023-06-23T23:42:57Z")

</div>

To minimize bouncing, a good first step would be to change the dummy’s PhysicsShapeType to be BABYLON.PhysicsShapeType.CAPSULE instead of a box. That should make a noticeable difference.

I think the rest will require fiddling with different friction, restitution, or mass values of the dummy & ground.

Maybe @Cedric or @carolhmj can give a better answer 🙂

---

<div class="post-metadata">

**Author:** ![Marcello\_Fabbiani](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/marcello_fabbiani/32/33022_2.png) [@Marcello\_Fabbiani](https://forum.babylonjs.com/u/Marcello_Fabbiani)\
**Post date:** [June 24, 2023, 12:41am UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/3 "2023-06-24T00:41:27Z")

</div>

changed to CAPSULE is better now, thanks 🙂

> **[Babylon.js Playground](https://playground.babylonjs.com/#Z8HTUN%23460)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [June 24, 2023, 1:05am UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/4 "2023-06-24T01:05:28Z")

</div>

It’s because the edges of the box shape collided with the vertices/triangle edges of the mesh shape.

If you open Inspector, go to debug tab, you can turn on physics viewer to see what happens 🙂

---

<div class="post-metadata">

**Author:** ![Marcello\_Fabbiani](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/marcello_fabbiani/32/33022_2.png) [@Marcello\_Fabbiani](https://forum.babylonjs.com/u/Marcello_Fabbiani)\
**Post date:** [June 26, 2023, 3:54am UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/5 "2023-06-26T03:54:21Z")

</div>

reducing the heightmap subdivisions stabilish the player

---

<div class="post-metadata">

**Author:** ![Marcello\_Fabbiani](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/marcello_fabbiani/32/33022_2.png) [@Marcello\_Fabbiani](https://forum.babylonjs.com/u/Marcello_Fabbiani)\
**Post date:** [July 1, 2023, 5:25pm UTC](https://forum.babylonjs.com/t/havok-physics-wlaking-character-bouncing-over-heightmap/41879/6 "2023-07-01T17:25:52Z")

</div>

I end up using ammo’s kinematicCharacterController  
The only bug that remains is that when the player collides the table he step up over the table without jumping, the table have mass of 0, if you collide the barrel it will not happens because the barrel is dynamic, and if you collide with the wall it will not happen because the wall is too tall.  
I want to find out which is the parameter of kinematicController that prevents this behaviour

[msfs1992.github.io](http://msfs1992.github.io)
