Animation and collisions

Hello :upside_down_face:,

I’m little stuck, I don’t know how to apply collisions and gravity to my animated mesh. I know I can use moveWithCollisions to my mesh ( and he does works without animation ) but I can’t/don’t know how to use it with the animation. It return an error if I apply it directly to the frame.
There’s an example, use aswd to move the cube:
https://www.babylonjs-playground.com/#I1RATT

I did try to use Ammo engine but it did not work either:
https://playground.babylonjs.com/#DYGD08#1

Thanks in advance :slightly_smiling_face:

See line 152

https://www.babylonjs-playground.com/#I1RATT#1

You are looking to check if 2 meshes are colliding so this is one built in method you can use.

See console output for when meshes collide

Thanks a lot !

1 Like