Follower Entity A to B path and B to A not the same

Hi guys. I am having trouble with follower entity in some specific cases. I really need that my path from A to B is same as B to A, but algorithm somehow calculates them differently.

Is there a way that once calculated i can transfer shorter path for my agent to take just going backwards? or is there some other solution. This rarely happens but in some cases this would bug out my game a lot.

I tried declaring MovementPath path as chatGPT suggested but i get error that that namespace doesnt exist…
oh well… Looking forward for your help :smiley:

Hi

There’s no guarantee that the path is the same in both directions, as long as the cost is the same.

You could calculate the path yourself, and then just before calling ai.SetPath with the finished path, you would reverse path.path, path.vectorPath and swap path.startPoint with path.endPoint (and same for other similar fields).

@aron_granberg


Screenshot_16

Aron, i tried first to just set path with seeker and see how fallower entity will behave.
2 problems i encounteres.
1st - on one of phones, path still had zig zags even after i added Funnel Modifier (lowered number of zig zags but kept some).
2nd - My agent also isnt moving after setting ai.SetPath(path)

I am stuck on my project on this, had several other cases where i used movement scripts but without any issue, here i really need that path from A to B and B to A are set to be the same. So please help :smiley:

best regards

But it’s working on other phones, just not a specific ones? Can you share the model of these devices, working and not working?

How are you assigning their movement? SetPath both ways? Or pathfinding normally at first then grabbing the path before traversal? Seeing your code might be helpful here :smiley: