My bool wont change, I want to have an attacking animation, tha attacking animation will start by my bool Angrep gets true, but nothing happens when I press Mouse0… Here is the script and a picture of my animator… using UnityEngine;
using System.Collections;
public class PlayerAttack : MonoBehaviour {
// PlayerMovement plMovement;
PlayerInput plInput;
Animator anim;
public float comboRate = 0.5f;
WaitForSeconds comboR;
public GameObject damageCollider;
// Use this for initialization
void Start () {
plInput = GetComponent<PlayerInput>();
anim = GetComponent<Animator>();
comboR = new WaitForSeconds(comboRate);
damageCollider.SetActive(false);
}
// Update is called once per frame
void FixedUpdate () {
if(plInput.fire1)
{
anim.SetBool("isAttacking", true);
// plMovement.canMove = false;
StartCoroutine("CloseAttack");
}
}
IEnumerator CloseAttack()
{
yield return comboR;
anim.SetBool("isAttacking", false);
}
public void OpenDamageCollider()
{
damageCollider.SetActive(true);
}
public void CloseDamageCollider()
{
damageCollider.SetActive(false);
}
}
