Hi @aron_granberg! I’m creating path via shift+click.
public override void SetPath(Vector3 destination)
{
pathCurrent = ABPath.Construct(AI.position, destination, OnPathComliteSetEndPoint);
Seeker.StartPath(pathCurrent);
pathCurrent.BlockUntilCalculated();
}
public override void AddToPath(Vector3 destination)
{
if (AI.hasPath)
{
if (destination != Vector3.zero)
{
pathCurrent = Seeker.GetCurrentPath();
pathNew = ABPath.Construct(pathCurrent.vectorPath.GetLast(), destination, OnPathCompliteAddRange);
AstarPath.StartPath(pathNew);
pathNew.BlockUntilCalculated();
//Seeker.StartPath(pathNew);
}
}
else
{
SetPath(destination);
}
}
callbacks and debug for checking destination
public override void OnPathComliteSetEndPoint(Path p)
{
if (p.error)
{
Debug.LogWarning("ABPath p.error - " + p.errorLog);
}
else
{
Seeker.PostProcess(p);
AI.destination = p.vectorPath.GetLast();
}
DebugDestination();
}
public override void OnPathCompliteAddRange(Path p)
{
if (p.error)
{
Debug.LogWarning("ABPath p.error - " + p.errorLog);
}
else
{
//pathModifier?.Apply(p);
Seeker.PostProcess(p);
AI.destination = p.vectorPath.GetLast();
pathCurrent.vectorPath.AddRange(p.vectorPath);
DebugDestination();
}
}
void DebugDestination() {
var point = GameObject.CreatePrimitive(PrimitiveType.Sphere);
point.transform.position = AI.destination;
}
but AI.reachedDestination and AI.reachedEndOfPath return true when the unit got first destination.
What I’m doing wrong?
I was trying same on unity store version and on the last one with burst, same results.