override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { deathpoint = GameObject.Find("deathpoint"); boss = GameObject.FindGameObjectWithTag("boss"); controlboss = boss.GetComponent <bosscontroller>(); batspawn = new Vector2(boss.transform.position.x + 1, boss.transform.position.y - 2); bossspawn = new Vector2(boss.transform.position.x + 1, boss.transform.position.y + 3); Instantiate(bossphase2, bossspawn, boss.transform.rotation); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { rand = Random.Range(0, 2); playerpos = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); animator.SetInteger("howmanyattacks", animator.GetInteger("howmanyattacks") + 1); Debug.Log("ATTAACKS " + animator.GetInteger("howmanyattacks")); boss = GameObject.FindGameObjectWithTag("boss"); controlboss = boss.GetComponent <bosscontroller>(); if (animator.GetBool("facingright")) { target = new Vector2(playerpos.position.x + 7f, boss.transform.position.y); } else { target = new Vector2(playerpos.position.x - 7f, boss.transform.position.y); } }