How do you set up navmesh agents to go to multiple destinations. Am making a hunting game, level by level number of wolf will increase but Levle fail or complete on the wolf that is at “0” num.Remaing all atack or killed by me no change occur…
NavMeshAgent agent;
void Start () {
agent= GetComponent<NavMeshAgent>();
agent.destination = enemy *.position;*
-
}*
-
void Update () {*
_ if (enemy ) {_
_ var Distance = Vector3.Distance (enemy .position, transform.position);
* var Distance1 = Vector3.Distance (gaurd.position, transform.position);*_
* if (Distance > 1 && Distance <= 2) {*
* agent.SetDestination (gaurd.position);*
* animation.Play (“death”);*
* dead = true;*
* if (animation [“death”].enabled == true) {*
* agent.Stop (true);*
* print (“dead true”);*
* dead = true;*
* }*
* } else if (Distance > 3 && Distance <= 4) {*
* agent.SetDestination (gaurd.position);*
* animation.Play (“getHit”);*
* agent.Stop (true);*
* } else if (Distance >= 5 && Distance <= 40) {*
* agent.speed = 4;*
* agent.SetDestination (gaurd.position);*
* animation.Play (“run”);*
* } else if (Distance >= 41 && Distance <= 70) {*
* agent.speed = 2;*
* agent.SetDestination (gaurd.position);*
* animation.Play (“walk”);*
* }*
* }*
* else*
* {*
* animation.Play(“Take 001”);*
* agent.Stop(true);*
* deadWolf=true;*
* }*
* } *
* }*