Search code examples
libgdxbox2dmomentum

How to stop seek (steering behaviour) orbiting target in Box2D?


Ok so I currently have a very simple steering behaviour on my game. One object chases another. The problem is that the chasing object ends up orbiting the other object indefinitely. Is there any way of solving this in box2d? Right now all I've got is linear damping, which slows it down when it gets close which kind of helps but I really want to kill the momentum so it can immediately change direction kind of like on Step 7 of this tutorial: http://code.tutsplus.com/tutorials/hit-the-target-with-a-deadly-homing-missile--active-8933 ... except in Box2D.


Solution

  • I used the setLinearDamping() method in the end which slowed the chaser as it got closer.