Closed paulbreuler closed 6 years ago
Fixed by adding a check to prevent actions until the unit is moving again. Also, updated the next action interval to prevent default values from causing the timer to always be greater than nextActionTime resulting in updates every frame.
// If we don't check !isMoving the AI may get stuck waiting to update the grid for nextActionTime. if (isSafeToUpdatePath || (!isMoving && isTargetReached && !preventExtraNodeUpdate)) { preventExtraNodeUpdate = true; UpdateNodePosition(); }
AI was waiting for next action timer before updating nodes to unwalkable. Temporary fix applied.
// If we don't check !isMoving the AI may get stuck waiting to update the grid for nextActionTime. if (isSafeToUpdatePath || (!isMoving)) UpdateNodePosition();
Need to update nodes only on stop and start of movement rather than each frame we are stopped.