Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Input.GetButtonDown ("Attack1"))
- {
- animator.SetTrigger ("Attack_01");
- StartCoroutine("Attack1");
- }
- IEnumerator Attack1()
- {
- yield return new WaitForSeconds (0.5f);
- attack1 = true;
- yield return null;
- attack1 = false;
- }
- void OnTriggerEnter2D(Collider2D other)
- {
- if (other.tag == "Enemy" && attack == true)
- {
- other.GetComponent<Animator>().SetBool ("Death_bool",true);
- other.GetComponent<Animator>().SetTrigger ("Death");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement