Make the sphere pass through the cylinder hole

Hello BBBoys ,
In this case im steel learning about physics.
I would like to share this playground where I need to pass the sphere through a cylinder hole:
not working example
Why it is is not working ?
BTW , I already tryed multiple PhysicsShapeType shapes without any luck.
Thanks for your help.

In case of complex shapes one need to use BABYLON.PhysicsShapeType.CONVEX_HULL.
In this case your PG will work - https://playground.babylonjs.com/#OYID75#1

1 Like

The cheapest one is CONVEX_HULL, but the top is closed so it cannot be inserted.

1 Like

Sorry but I disagree, CONVEX_HULL is convex, which means no cavity, no hole… The playground you linked triggers and error and in fact no physic body is actually assigned to the shapes, I guess that’s why it looks like it works :grin:


I think solution provided by @11128 (MESH) is necessary in that case :slight_smile:

1 Like

I believe you are right :slight_smile:
The error was due to some meshes had no geometry.
Here is the working example with MESH shape type - https://playground.babylonjs.com/#OYID75#3
Moved a bit to show that the ball bounces from outside - https://playground.babylonjs.com/#OYID75#4

Hello guys , I got it working as expected.
The trick is to assign physics to the meshes but not to root mesh.
Let me share:
now it works !!
Thanks for the quick responses !!