public void SetGoalFindNearestArea(Area target, float maxSearchCost, bool snapToNavMesh = true, bool applyRaycast = false) { if (_canRecieveGoals == false) { return; } if (!properties.doNavMesh) { Debug.LogWarning("you trying to get path when you dont even set properties to generate NavMesh"); return; } if (properties == null) { Debug.LogError("Agent dont have assigned Properties"); return; } lock (this) if (canSendPathRequest == false) { return; } PathFinder.GetPathAreaSearch(this, target, true, maxSearchCost, positionVector3, snapToNavMesh, null, applyRaycast); }