Hey, I’m having an issue with blocking on a node in case I try to use EndingConditionProximity. I this case the seeker ignores the SingleNodeBlocker blocked position. I try to use this to get to closest position to either ranged or melee attack. See the result here:
This is the code I use regularly in case I know the final destination:
public static void TakeStepsTowards(AILerp ai, Seeker seeker, Vector3 destination,
ITraversalProvider traversalProvider)
{
ai.canSearch = false;
var path = ABPath.Construct(ai.position, destination);
path.traversalProvider = traversalProvider;
seeker.StartPath(path);
path.BlockUntilCalculated();
}
This is the one causing issues:
public static void TakeStepsTowardsToReachDistance(AILerp ai, Seeker seeker, Vector3 destination,
ITraversalProvider traversalProvider, int distanceFrom)
{
ai.canSearch = false;
var path = XPath.Construct(ai.position, destination);
path.traversalProvider = traversalProvider;
if (distanceFrom > 0) //not sure if this has to be here
path.endingCondition = new EndingConditionProximity(path, distanceFrom);
seeker.StartPath(path);
path.BlockUntilCalculated();
}
Could you please help?