//Looks for the next nav point along the navigation path public void GetNextNavPoint() { pathCount = (pathCount + 1); if (pathCount >= path.Length) { pathCount = 0; } ai.SetTarget(path[pathCount].transform); }
// public void SetTimeN(float currentTime){ // if(!init){ // if(WpresentFrom < WpresentTo){ // if(WpresentFrom < currentTime){ // if(currentTime < WpresentTo){ // } else { // gameObject.SetActive(false); // } // } else { // gameObject.SetActive(false); // } // } else { // if(currentTime < WpresentTo){ // } else { // gameObject.SetActive(false); // } // } // init = true; // } // } public void SetRandomDestination() { if (_AIController != null) { GameObject newTarget = GameSettings.GetRandomTarget(); if (newTarget != null && _AIController.isActiveAndEnabled) { // Debug.Log(gameObject.name + " is now moving toward " + newTarget.gameObject.name); _AIController.SetTarget(newTarget.transform); } } }
//setting object to target public void SetNewTarget(string thingToTarget) { Transform target = this.transform; if (thingToTarget == "Player") { target = enemyToChase.transform; } else if (thingToTarget == "Patrol") { int i = UnityEngine.Random.Range(0, navPoints.Length); target = navPoints[i].transform; targetSet = true; } else if (thingToTarget == "None") { target = this.transform; targetSet = true; } ai.SetTarget(target); }
public void GoToPosition(Transform position) { StandardIAControl.SetTarget(position); StartCoroutine(TestIfStopped()); }
void TargetTV() { selfLargeAI.SetTarget(tv.transform); }