Need some help on how to stop mesh bounce (cannonjs)

I’ve been trying to figure out how to prevent a box mesh (playing card) from bouncing from another box mesh (table) with cannonjs physics enabled on these objects.

I’m making 50 cards drop from a certain height onto a table, but cannot get the cards to stop from bouncing off the table and from each other. Because of this, the cards eventually slide down and don’t remain in a stack anymore.

I have set the restitution of the cards and table to 0. Is there a way to properly make the cards not bounce when they collide to the table and with each other?

Any help will be greatly appreciated!

https://playground.babylonjs.com/#HNSE1E#1

1 Like

Hello! and welcome :slight_smile:

pinging @cedric

1 Like

Hi @rand00

I managed to limit the sliding effect but the bouncing is still there but way less visible.

https://playground.babylonjs.com/#HNSE1E#3

This is due to the physics engine. There are many small collisions and the engine resolves them by adding a counter force. When this happens on a layer made of many bodies, you get bouncing.
It’s possible to limit that effect but not possible to totaly remove it.

Usually, setting a smaller mass and increasing friction limit the issue.

2 Likes

@Deltakosh thanks for the welcome!
@Cedric this will work fine, thank you for the help, i appreciate it!

2 Likes