Very simple ABPath query

I am wanting to generate a path between 2 points and then manually move an entity from waypoint to waypoint.

I am currently doing:
var startPosition = sourceGameObject.transform.position; var endPosition = destinationGameObject.Value.transform.position; var pathFinishedDeletate = new OnPathDelegate(path => { if (path.error) { OnPathFailed(path); } else { OnPathSuccess(path); } }); var pathPlaceholder = ABPath.Construct(startPosition, endPosition, pathFinishedDeletate); AstarPath.StartPath(pathPlaceholder);

The documentation is very unclear on how to use ABPath without a Seeker component. I was under the impression that the Seeker component is not needed and was just there to just simplify usages. So assuming I have an entity with a character controller and I want to move him to each waypoint is there anything wrong with the above?

As the moment I get OnPathSuccess and start itterating round the vectorPath the entity starts walking in the opposite direction… So not sure if I am doing something wrong or if there is something else amiss…

A bump incase anyone can confirm you do not need a seeker component and I am using it the correct way.


No, you do not need a Seeker component. What it does is basically to do some post processing for you (e.g smooth the path).

Your script looks correct. But I obviously cannot say anything about your movement code. Try debugging that with Debug.DrawLine or something similar.

ok will do, thanks for getting back to me. I used to get this sort of behaviour when using the playmaker scripts for A*. It would just go off in opposite directions and I could not work out why…

It seems that the Character Controller Move method should not use an absolute point and instead should be the relative distance to move from what I can tell, which may have caused me some issues, but I am also finding that sometimes it fails to make a path, but this is all a bit wooly so need to investigate further.