2
\$\begingroup\$

I'm using libgdx Follow Path Steering Behavior in my top-down game. When unit reaches the end of the path, it goes to the start (not directly, but following path), then to the end and so on. How to stop following path, when unit reached the end point?

\$\endgroup\$
1
\$\begingroup\$

Try FollowPath#setArriveEnabled(boolean). It allows you to set whether or not to use Arrive behavior to approach the end of an open path.

Additionally, you might want to take a look at FollowPath#setArrivalTolerance(float)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Using Arrive has no effect, also with high ArrivalTolerance. \$\endgroup\$ – Andrei Yusupau Oct 17 '15 at 9:32
  • \$\begingroup\$ experimenting with different parameters made Arrive work. But there is another problem (maybe because of predictionTime), my steering object stops in some distance to target. How can I fix it? \$\endgroup\$ – Andrei Yusupau Oct 17 '15 at 12:46
0
\$\begingroup\$

When unit reaches to the end point then you can simply reset the position of the unit as previous what it was and then continue like in this manner or you can simply destroy the path after you done with it if possible.

I don't know about your platform but the concepts are same for any platform.So if my answer is helpful then please vote. ;)

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.