Hi
I have a UFO which shall pass around a object while still pursuing my ship. I can’t solve this without trembling UFO. Here is what I’m doing:
1.UFO pursues my ship (solved, no problem here).
-
UFO has a invisible, sensor circle physics body which detects collision (so that the UFO doesn’t approach too much)
-
When the circle collides with the object some math is done to identify the objects boundary angle (e.g. the tangent to the circle).
-
The circle (and UFO) moves in one direction (the shorter to my ship) along the object
-
If the collision is ended the pursue continues.
So far the theory. But collision is only recognized once, then I have to move the circle/UFO away from the object, to allow a next collision which enables to correct the path around the object. But this results in a trembling: The UFO aproaches, flies away, aproaches, flies away, etc etc.
Is there a concept that would allow the UFO a smooth passing around a object?
Thanks for your help and sorry for my english…
Olivier