- A* version: [5.2.4]
- Unity version: [2022.3.52f1]
I have a question regarding the visualizing of a path with Follower Entity.
Currently I’m using Follower entity as my movement script, I’m making a turn-based game inspired by games like XCOM2 & BG3 etc.
I’m trying to replicate the previewing of a character’s path when hovering over walkable area’s. To do so I added a seeker component (& funnel modifier) to my characters, when hovering walkable area’s I simply shoot a raycast, get the position, calculate the path with my Seeker and make use of a linerenderer to display the path.
This worked fine, until I found some small inconsistencies between the previewed path of the seeker component and the actual path my FollowerEntity takes.
Therefore I wanted to scrap the whole preview with a seeker component & solely make use of the FollowerEntity. That’s where I’m stuck I have been reading the doc but can’t seem to find a way to “simulate” the path a FollowerEntity would take.
I tried using the GetRemainingPath() but this only works when the entity is actually moving.
Any insights?
For more information here are some screenshots of my graph & agent config
What you can do here is use FollowerEntity.SetPath()
to apply a path you create to your unit- either through Seeker or just ABPath.Construct()
. (If you use Construct you’ll also want to post process that path manually if you want that).

This is my issue, as you can see my agent doesn’t follow the previewed path (even when using .SetPath() with my Seeker)
Correct me if I’m wrong but currently in the code, when an agent moves it doesn’t strictly follow the given path right? Maybe the agent takes other factors into consideration when moving to the destination (I’m really guessing here but maybe in my case, stepping on that box costs more than going around it?)
Also I don’t allow my agent to rotate on itself, so when moving backwards it first moves in an arc and not a straight line. When visualizing the path it also doesn’t take this into consideration.
- The blue line is the path calculated by the seeker (or ABPath.Construct())
- The green line is the actual movement my agent will make when moving
I currently have a workaround where I just add a curve based on the rotation of the agent & the destination. But it would be great if I had a way to really predict the exact movement of my agent, it would fix both this issue and the one stated above.
Hi
I think this should be possible in theory by adding another ECS world, adding the relevant systems/system groups to it (check the ECS Systems inspector for the ai movement group), copying the FollowerEntity’s entity to that world, and then simulating the world for many steps in a single frame.
Definitely a bit of code to do it, though.
agent.canMove = false;
agent.SetPath(null);
agent.destination = request.TargetPosition;
agent.SearchPath();
wait for ‘agent.hasPath == true’, and then use ‘GetRemainingPath()’
Nabil, cant you make tiny/transparent object that will have Fallower entity, start from your Agent position and targetDestination is what u get from raycast, searchPath with it, then GetRemainingPath to get Vector3s and draw direction with linerenderer and destroy that object after done. You should get data u need for your actual agent which he will fallow since both are using fallower entity no?