I’m trying to move some path finding from using the Seeker to manually calling the system. But for some reason it’s returning odd values in the vectorPath. Here’s my code that works fine with the Seeker component:
void CalculatePath()
{
//m_seeker.StartPath(m_trans.position, m_targetPosition, OnPathCompleted, AIGraphMask);
ABPath currentSearchPath = ABPath.Construct(m_trans.position, m_targetPosition, null);
currentSearchPath.callback += OnPathCompleted;
currentSearchPath.nnConstraint.graphMask = AIGraphMask;
foreach (MonoModifier monoModifier in m_modifiers)
{
monoModifier.PreProcess(currentSearchPath);
}
AstarPath.StartPath(currentSearchPath);
}
void OnPathCompleted(Path p)
{
if (p.error)
{
...
return;
}
foreach (MonoModifier monoModifier in m_modifiers)
{
monoModifier.Apply(p);
}
m_currentWaypointIndex = 0;
CurrentPath = p;
}
and here’s the output of the call as you can see the vectorPath returns points that doesn’t match with the endPoint.