I have checked other topics but can’t really find a solution thus far.
I have my movement (4 connections, grid based graph) working like this:
It does work properly on a straight line but when it comes to an opening, it cuts the corner diagonally (smoothly).
I would like for it to move like this:
Would anyone have any ideas how I should adjust to achieve this?
I am using the Follower Entity and the aidestinationsetter if that helps.
Thanks so much for any help that could be provided!
This came up in a thread before and Aron suggested using the Manhattan Heuristics option:
Hi
It’s not possible to find a path with the minimal number of turns in this package. This would require a different pathfinding algorithm. It’s not easy to just bolt on, I’m afraid.
However, you can get pretty good results using the manhattan heuristic.
You mention that you want to do this for only some enemies. Fortunately, you can set this value per-path.
// Disable the agent's built-in path searching routine
ai.canSearch = false;
var path = ABPath.Construct(...);
path.heuristic = Heuristic.Manhattan;
ai.SetPath(path);
Thank you. I did see this and tried Manhattan but that didn’t seem to make a difference. I am not scripting my own ai path rather, I am using the built in setup. I am not quite sure how I can make use of this?
Hi
I would suggest using the AILerp movement script instead. Take a look at its documentation page for how to configure it for this kind of movement:
Hey awesome, so I have this setup now. How do I get it to follow a transform (my Player)? Kindly forgive my very basic knowledge at this point.
When I added the AILerp, it also added a script called seeker. I have setup as it said in the documentation for strict movement along connections.
That’s the AIDestinationSetter component. Same as the other movement scripts.
Ha! That worked perfectly! Thank you so very much!