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.
Asked
Active
Viewed 673 times
2 Answers
0
Maybe something like this:
if(//on target area){
setLinearVelocity(0f,0f);
setAngularVelocity(0f);
steeringBehavior = null;
}
P.S. Probably, you may use Arrive behavior instead (it has a drag to stop on target)

Andrei Yusupau
- 587
- 1
- 11
- 30
-
Arrive was similar to what I used but it wasn't exactly what I wanted. Thanks though – Jack Jacques Apr 09 '15 at 01:17
0
I used the setLinearDamping()
method in the end which slowed the chaser as it got closer.

Amit Joki
- 58,320
- 7
- 77
- 95

Jack Jacques
- 23
- 4