Click and drag a mesh with physics


I want to do a simple scene where there would be a lot of cube with rigid body on a surface.
When you click on a cube and by holding the mouse, you could drag that cube around on its x,y axis and collide with the other cube. The goal would be to clean the surface and see a message under.

I tried using the Basic Mouse Input tutorial as a start but the cube doesn’t interact with other rigid body even if it have one and I would like the scene to be in a 3D perspective instead of in a top down view.

Any tips?

It’s a tricky thing to do with physics. I did something similar with Virtual Voodoo ( and I think I used a joint (not exposed by PlayCanvas but accessible in the Ammo.js engine) and moved the joint around with the mouse.