public void GoToFriend() { if (!friend || !controlAI) { return; } if (friendDistance > minFriendDistance) { controlAI.SetSpeed(friendDistance > minFriendDistance * 2 ? vAIMovementSpeed.Running : vAIMovementSpeed.Walking); controlAI.MoveTo(friend.transform.position); } else { controlAI.LookTo(friend.transform.position); controlAI.Stop(); } }
public void MoveToTarget() { ai.MoveTo(target.position); ai.SetSpeed(vAIMovementSpeed.Running); }