Hello I have a method called Atttack() that is responsible for playing the attack animation of my player but its causing a stack overflow in my if statement.
private void Attack()
{
Weapon currentWeapon = handsInv.GetItem(manager.currentlyEquipedWeapon);
if(Time.time > lastClickTime + currentWeapon.attackRate)
{
anim.SetTrigger("clickedAttack");
lastClickTime = Time.time;
}
}
It points to the if statement of Time.time > lastClickTime + currentWeapon.attackRate where lastClickTime is a private float attackRate is an integer from my Weapon class. Anyone know how to fix? thanks!
↧