// Update is called once per frame void Update() { GetComponent<NavMeshAgent>().destination = persuit.position; persuitHasBall = GameObject.Find(persuit.name).GetComponent("WRAI") as WRAI; if(persuitHasBall != null){ //only under certain cirumstances check it if its null dont even try persuitHasBallInt = persuitHasBall.hasBall; } if(persuitSack != null){ sackHasBallInt = persuitSack.hasBall; } if (hasBall == 1){ print("they have the ball"); // theBrain.ballCarrier = "DE"; //print(theBrain.ballCarrier); } }
// Update is called once per frame void Update() { GetComponent <NavMeshAgent>().destination = persuit.position; persuitHasBall = GameObject.Find(persuit.name).GetComponent("WRAI") as WRAI; if (persuitHasBall != null) //only under certain cirumstances check it if its null dont even try { persuitHasBallInt = persuitHasBall.hasBall; } if (persuitSack != null) { sackHasBallInt = persuitSack.hasBall; } if (hasBall == 1) { print("they have the ball"); // theBrain.ballCarrier = "DE"; //print(theBrain.ballCarrier); } }