Prevent tunnelling on drag

Hi guys

I'm quite new to Box2dweb so still getting the hang of it all but theres 1 thing I can't quite figure out.

I'm creating a pool game, when the user has cueball in hand I allow them to drag it to wherever they want on the table. When this drag happens I set the object balls to static so that there are no collisions, however the cueball still tunnels into them - and if you let go of the mouse when this happens both the cueball and object ball move.

Is there anything I can do to stop this? Just a general nudge in the right direction would be much appreciated.

Thanks
Lee
The ball you are dragging is a dynamic body? Dragging it with a mouse joint?
As long as you destroy the joint before returning the other balls to dynamic I would expect it to be ok. Maybe you need to run the simulation for a few timesteps after releasing the dragged ball to make sure any slight penetration has been corrected.
Hi

Yes the ball I'm dragging is dynamic and using a mouse joint, sorry I should have stated that in my previous post.

Thanks for your reply, it certainly lit a lightbulb and I've managed to get it working now! Thanks alot.

Lee

Original thread: https://box2d.org/forum/viewtopic.php?t=8994