XPath throwing strange errors

Probably a beginner question but i have some issues with XPath atm. After taking a lot of functionality out of AIPath and mixing it into my own AI movecontroller class everything was working fine. Untill I decided that I needed a way for a path to end early or end on an area. So XPath with proximity endcondition was the next step. After implementing it I constantly get “path failed callback references seeker” messages. Giving no additional information and stepping through the code I found that the call for the seeker is very much intended.

Current code in my SearchPath() function, all other relevant parts are very similar to AiPath

    XPath p = XPath.Construct(GetFeetPosition(), targetPosition, null);

    p.endingCondition = new EndingConditionProximity(p, fProximityConditionRange);

    oSeeker.StartPath(p);

Am I doing something wrong? maybe using XPath wrong?

Edit: In addition, when I set the seeker to not remember my own callback and just pass it to construct only, I get the same error only that it points at my own AiController behaviour now.

Edit: p.errorlog is empty, no additional info given

Hi

Which version are you using?
I know in some 4.x versions there is a bug which causes the error message for paths not to be included in the log message. The reason the path failed should however still be logged as a separate log message, try to look for it.

I am on 4.0.10

As an additional warning (that i didn’t notice because i collapsed my console) it says:

Searched whole area but could not find target

Could it be that adding the endingcondition but setting its validation radius to 0 causes it to fail even when the intended point is on the navmesh?

That could very well be the issue. It is trying to find a node which is exactly at the point that you specified, but that is not very likely. You could change the EndingConditionProximity class to use endNode.position instead of originalEndPoint.

public override bool TargetFound (PathNode node) {
	return (node.node.position - abPath.endNode.position).sqrMagnitude <= (maxDistance*Int3.Precision)*(maxDistance*Int3.Precision);
}

Note that the squared magnitude is now in Int3 space (in which 1 unit is 1mm) which is why I also added a multiplication by Int3.Precision.

I’ll test this once I’m done with my current tasks. In the meantime to circumvent the issue, I inherited from ABPath and hooked into the calculate step to add my own checks there. It’s basically doing the same thing but instead of a neat separate module it’s right there in the path off course. In addition, this will allow me to create reachable “zones” more easily so i can path to the easiest to reach point on a rectangle and such once i get deeper into the checks.