0
votes

So I have a dynamic draggable object that I want it to collide with a static wall. I managed to get it done by adding a boolean that becomes false in the collision function, and back on again in touch began and it works perfect, except for one thing, when I drag the object very fast it still goes through the wall. I even added this line of code:

physics.setContinuous( false )

But it didn't make any difference. So, my question is, how to get the physics engine to detect a collision when one of the objects is moving fast?

1

1 Answers

0
votes

Possible workaround/solution for your problem

  • The best solution is to make the "walls" thicker, if that is possible within your game,
  • You may increase the velocity and position iterations

    physics.setVelocityIterations(value) (8 is default value) 
    
    physics.setPositionIterations(value) (3 is default value)
    
  • use object.isBullet = true more information

Last two sugesstions may result in a slight performance penalty.

More information you can find from links below