those units that were moving sometime ago keep on pushing to Debug.Log, even if they didnt have command to move after that
Looks like they keep computing the path to their current pos. I dont mind if its needed for some reason, but is there a way to disable spam in Logs?
public void MoveTo(Vector3 position, float stoppingDistance)
{
if(damagableUnit.IsAlive() == false) return;
agent.canMove = false;
StopAllCoroutines();
MoveCoroutine = StartCoroutine(MoveToCoroutine(position, stoppingDistance));
}
private IEnumerator MoveToCoroutine(Vector3 position, float stoppingDistance)
{
agent.endReachedDistance = stoppingDistance;
agent.destination = position;
agent.canMove = true;
while (agent.reachedDestination == false)
{
yield return null;
}
agent.canMove = false;
MoveCoroutine = null;
}