# Physics not detecting heightmap collision with latest 5-alpha

**URL:** <https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695>\
**Category:** Bugs\
**Created:** [September 9, 2021, 11:04am UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695 "2021-09-09T11:04:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [September 9, 2021, 11:04am UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/1 "2021-09-09T11:04:16Z")

</div>

Hi,  
I’ve noticed that heightmap collision (cannon) doesn’t work as expected anymore. See this PG [https://www.babylonjs-playground.com/#4VM49Q#12](https://www.babylonjs-playground.com/#4VM49Q#12) and switch between `latest` and `4.2.0` With `latest` The spehere ‘falls’ through the ground after a couple of seconds.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 9, 2021, 12:11pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/2 "2021-09-09T12:11:49Z")

</div>

Let me take a look.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 9, 2021, 12:51pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/3 "2021-09-09T12:51:33Z")

</div>

As a workaround, setting the ground impostor as a `MeshImpostor` will work. I continue investigating.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 9, 2021, 1:31pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/4 "2021-09-09T13:31:17Z")

</div>

PR is live

> <https://github.com/BabylonJS/Babylon.js/pull/11040>
>
> follow up https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collisio…n-with-latest-5-alpha/23695
> 
> Translation to center heightmap was wrong

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [September 9, 2021, 7:09pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/5 "2021-09-09T19:09:04Z")

</div>

@Cedric thanks a lot for the fix! This will be available via npm with `alpha.44`, right?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 9, 2021, 7:18pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/6 "2021-09-09T19:18:04Z")

</div>

Yup and we will probably release it either tomorrow or early next week 🙂

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [September 11, 2021, 3:37pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/7 "2021-09-11T15:37:29Z")

</div>

Seems that `alpha.44` doesn’t fix the problem. same behaviour. Maybe someone else can confirm.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 13, 2021, 8:02am UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/8 "2021-09-13T08:02:34Z")

</div>

I can repro. This is really weird. I’m checking what’s happening.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [September 14, 2021, 9:47am UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/9 "2021-09-14T09:47:36Z")

</div>

Second try :

> <https://github.com/BabylonJS/Babylon.js/pull/11069>
>
> This fix was not enough for Cannon Heightmesh : https://github.com/BabylonJS/Bab…ylon.js/pull/11040
> This one is better

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [September 14, 2021, 6:50pm UTC](https://forum.babylonjs.com/t/physics-not-detecting-heightmap-collision-with-latest-5-alpha/23695/10 "2021-09-14T18:50:43Z")

</div>

Thanks @Cedric now it works 🙂
