Hi, I’m on Unity 6000.0.32f1 and A* Pathfinding Project 5.3.3.
I’m building a Tower Defence game, where towers choose to shoot at the units closest to the destination. I want to use FollowerEntity.RemainingDistance
for this, but the values it gives are always very wrong.
Here’s my Unity Scene:
I generate a nice looking Recast graph on it:
That looks good. My (FollowerEntity) units are pathing very well, there’s nothing unusual about the paths they choose or how they move, I’m very happy with that.
To visualise the FollowerEntity.RemainingDistance
problem I’m experiencing, I have a unit path from the start to the destination, and, every few seconds along the way, create a Text object displaying the FollowerEntity.RemainingDistance
at that point in the journey. Here’s how that looks:
I would expect the number to begin at some value and steadily decrease to zero.
Instead, it fluctuates somewhere between 10 and 20, only decreasing to zero at the end, within about 10 metres of the finish.
The result is that the Towers the player makes seem very dumb! They, often enough, shoot the Unit furthest away from the end, rather than closest.
What’s going on here?