// Use this for initialization protected override void Start() { //gets the animator and collider components (yay i speeled it right!) anim = GetComponent <Animator>(); sc = GetComponent <SphereCollider>(); //gets own properties, navmesh and health info myProps = GetComponent <UzairCharacterProp>(); nav = GetComponent <NavMeshAgent>(); enemyHealth = GetComponent <UzairEnemyHealth>(); //gets the only Player object and store its health and animator info player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <UzairPlayerHealth>(); playerController = player.GetComponent <UzairPlayerController>(); //sets the local props to the Set zombie props attackInterval = myProps.attackInterval; attackDamage = myProps.attackDamage; speed = myProps.speed; transform.localScale += new Vector3(myProps.scale, myProps.scale, myProps.scale); //sets animator and navmesh speed anim.speed = speed; nav.speed = speed * 3; }
// Use this for initialization void Start() { //gets the only object with the player tag //and then stores its health info (like apple) player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <UzairPlayerHealth>(); //gets the collider compnenet sc = GetComponent <SphereCollider>(); }