# Collision detection on loaded 3D models

**URL:** <https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627>\
**Category:** Questions\
**Created:** [November 29, 2021, 3:23pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627 "2021-11-29T15:23:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danya\_rnd](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/danya_rnd/32/26493_2.png) [@danya\_rnd](https://forum.babylonjs.com/u/danya_rnd)\
**Post date:** [November 29, 2021, 3:23pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/1 "2021-11-29T15:23:40Z")

</div>

Hello. I spent a week for trying to create collisions with room builder and cannot understand next:

1. Why the item is draggable by Y axis if dragPlaneAxis is (0,1,0) in pointerDragBehaviour. (This case only happens with room, with ground it’s working properly)
2. And why items has wrong collision detection with room and each other?

This is my playground: [https://playground.babylonjs.com/#4BTHHJ#6](https://playground.babylonjs.com/#4BTHHJ#6)

It has the same config as i’m using in my project. Hope someone can help ☹

---

<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:** [November 29, 2021, 3:34pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/2 "2021-11-29T15:34:00Z")

</div>

Add this so plane for pointer drag is not updated:

```auto
pointerDragBehavior.updateDragPlane = false;

```

---

<div class="post-metadata">

**Author:** ![danya\_rnd](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/danya_rnd/32/26493_2.png) [@danya\_rnd](https://forum.babylonjs.com/u/danya_rnd)\
**Post date:** [November 29, 2021, 3:39pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/3 "2021-11-29T15:39:34Z")

</div>

Thank u for your answer. Doesn’t help - [Test collision on model](https://playground.babylonjs.com/#4BTHHJ#7)

Item still going up.

---

<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:** [November 29, 2021, 4:13pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/4 "2021-11-29T16:13:21Z")

</div>

that’s because of the ellipsoid size of the mesh.

> **[Mesh | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.mesh#ellipsoid)**
>
> Class used to represent renderable models \[API\]

I don’t think ellipsoid collisions will work for you.  
when moving the mesh, it will detect collision using ellipsoid and not a box.  
You should try using ammo or cannon.

---

<div class="post-metadata">

**Author:** ![danya\_rnd](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/danya_rnd/32/26493_2.png) [@danya\_rnd](https://forum.babylonjs.com/u/danya_rnd)\
**Post date:** [November 30, 2021, 10:20pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/5 "2021-11-30T22:20:56Z")

</div>

Okay. I will check out this. But i still don’t understand why model is movable by Y axis. What to do in this case?

---

<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:** [December 1, 2021, 8:56am UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/6 "2021-12-01T08:56:52Z")

</div>

when using ellipsoid collision, the mesh being moved slides against the other ellipsoid. You can see that by changing the size of the ellipsoid. the higher the ellipsoid, the higher it slides up.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 29, 2021, 2:03pm UTC](https://forum.babylonjs.com/t/collision-detection-on-loaded-3d-models/25627/7 "2021-12-29T14:03:10Z")

</div>

Hi @danya_rnd ! Just checking in, do you still have any issues? 😃
