# Physics, Ball falls through my Mesh from 3Ds Max

**URL:** <https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448>\
**Category:** Questions\
**Created:** [July 17, 2021, 1:21pm UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448 "2021-07-17T13:21:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 17, 2021, 1:21pm UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/1 "2021-07-17T13:21:28Z")

</div>

Can you please help me ? I drawed a roulette in **3Ds Max**. exported it with following settings:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/a/5ac30dbe1c51225b9d6a80d01be972146a05a5f7.png)

Enabled physics in the scene (used `this.scene.enablePhysics(new BABYLON.Vector3(0, -9.81, 0), new OimoJSPlugin())` ), made all **checkCollision** to **true** , created **MeshImpostors**. But my ball for roulettte (also created in **3Ds Max** ) falls through the roulette. It doesn’t fall through a ground, if to create in Babylon such, but just jumps on it, so physics is seem to be enabled… Also my roulette doesn’t fall itself even if to give it a mass = 10 (so physics doesn’t work with my roulette). So can you help me ? I can’t find a solution ☹

[https://playground.babylonjs.com/#YIU90M#388](https://playground.babylonjs.com/#YIU90M#388)

Thank you, waiting for your help

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 19, 2021, 9:05am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/2 "2021-07-19T09:05:56Z")

</div>

The PG does not work, the models can’t be found:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/f/2f2ff66c08163e94c53cd6ddf30123cc9b164583.png)

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 9:18am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/3 "2021-07-19T09:18:39Z")

</div>

Fixed. Please check again  
Waiting for help

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 9:22am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/4 "2021-07-19T09:22:13Z")

</div>

[Ball falls through roulette | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#YIU90M#401)

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 9:35am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/5 "2021-07-19T09:35:44Z")

</div>

Will you look ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 19, 2021, 9:37am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/6 "2021-07-19T09:37:28Z")

</div>

For some reason the mesh impostor does not work for the roulette: if you use another type of impostor, you don’t get any error (but the ball still does not collide with the roulette).

Adding @Cedric as I know nothing of physic engines.

The PG was still raising some errors for me, here’s a corrected version:  
[https://playground.babylonjs.com/#YIU90M#403](https://playground.babylonjs.com/#YIU90M#403)

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 9:47am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/7 "2021-07-19T09:47:06Z")

</div>

Okay. Thanks. Waiting for @Cedric help  
😄

p.s. you PG doesn’t show anything for me, so just in case put again my link for @Cedric  
[Ball falls through roulette | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#YIU90M#401)

---

<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:** [July 19, 2021, 9:50am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/8 "2021-07-19T09:50:11Z")

</div>

I’m taking a look!

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 19, 2021, 9:53am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/9 "2021-07-19T09:53:58Z")

</div>

> [@user\_of\_babylon](#):
>
> ou PG doesn’t show anything for me

That’s because it’s the PG with the MeshImpostor for the roulette. If using BoxImpostor:

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

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 9:55am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/10 "2021-07-19T09:55:01Z")

</div>

Now loaded… Previous PG doesn’t show anything at all (just white bgc)

---

<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:** [July 19, 2021, 10:34am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/11 "2021-07-19T10:34:59Z")

</div>

I was able to get physics by adding meshes one by one :  
[Ball falls through roulette | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#YIU90M#406)  
I need to check code why meshes need to be unparented.  
Also, you need to specify the type of impostor for each mesh you want to physicalize.

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 10:45am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/12 "2021-07-19T10:45:13Z")

</div>

So… what can I do to quickly enable physics ? May be I can go through all scene meshes (`for of scene.getChildMeshes()`) and do `mesh.parent = null`, make impostor for every ? What can you suggest ?

---

<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:** [July 19, 2021, 10:47am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/13 "2021-07-19T10:47:50Z")

</div>

Yes, you will have to get thru every mesh you want to physicalize and based on its name for example, create the impostor you need.

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 10:49am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/14 "2021-07-19T10:49:27Z")

</div>

and for my spots ? I should physicalize every spot or every text and rectangle on the spot ?

---

<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:** [July 19, 2021, 10:51am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/15 "2021-07-19T10:51:04Z")

</div>

Yes, that’s a possibility. With collision callback, you’ll be able to detect the rectangle the ball is over.  
I don’t how how performant it will be but I think it’ll be alright.

Check this for some more infos:

> [@How to properly import and setup physics objects - GLTf](https://forum.babylonjs.com/t/how-to-properly-import-and-setup-physics-objects-gltf/21943/2):
>
> Summoning @RaananW and @Cedric the kings of Physix

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 10:58am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/16 "2021-07-19T10:58:11Z")

</div>

```auto
for (let mesh of roulette.getChildMeshes()) {
            mesh.computeWorldMatrix(true);
            mesh.position = mesh.absolutePosition;
            mesh.parent = null;
            Playground.EnableRoulettePhysics(scene, mesh);
        }

```

will it be okay ? (but it now doesn’t show anything in canvas ☹ )

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 10:59am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/17 "2021-07-19T10:59:37Z")

</div>

or anyway, i can do it manually by `getMeshByName(`spot${counter}`)`

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 19, 2021, 10:59am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/18 "2021-07-19T10:59:49Z")

</div>

Thanks, will try to fix 😄

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 20, 2021, 9:32am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/19 "2021-07-20T09:32:58Z")

</div>

@Cedric , help, how now I can animate it ? Roulette must spin and it spinned. But now physics works (thank you for it a lot), but it now doesn’t spin via animation… It also doesn’t spin even if I change `spots.rotation` in `window.setInterval`

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/6/f6ba5e17b8d5a8ebe98515db70ec9418ee641c5f.png)

---

<div class="post-metadata">

**Author:** ![user\_of\_babylon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/user_of_babylon/32/17408_2.png) [@user\_of\_babylon](https://forum.babylonjs.com/u/user_of_babylon)\
**Post date:** [July 20, 2021, 9:38am UTC](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448/20 "2021-07-20T09:38:54Z")

</div>

Let me do it in PG. I will send a link in a couple of minutes

[Next page](https://forum.babylonjs.com/t/physics-ball-falls-through-my-mesh-from-3ds-max/22448.md?page=2)
