// Use this for initialization
    void Awake()
    {
        //closes overlay
        overlay.SetActive(false);

        //sets target to player
        target       = GameObject.FindGameObjectWithTag("Player").transform;
        playerHitBox = GameObject.FindGameObjectWithTag("Player").GetComponent <ControllerPlayer> ().hitBox;

        //sets instance nav agent
        nav = GetComponent <NavigateAgent> ();

        //gets the path follower
        follow = GetComponent <PathFollower> ();

        //gets animator of instance
        animator = GetComponent <Animator> ();

        //gets rigidbody
        controller = GetComponent <Rigidbody2D> ();

        //gets shooting controller
        shootCon = GetComponent <ShootingController>();

        //sets health and death state
        health  = StartingHealth;
        onDeath = false;

        if (rangeAngle == Vector2.zero)
        {
            rangeAngle = new Vector2(1f, 1f);
        }

        //gets sound
        ASound = GetComponent <AttackSoundEffect>();
    }
 private void Start()
 {
     nav        = GetComponent <NavigateAgent>();
     controller = GetComponent <Rigidbody2D>();
     GetComponent <Camera>().orthographicSize = startZoom;
 }