When resetting the timeSinceLastAttack, wouldn’t it be more accurate to have the timeBetweenAttacks substracted like this:
if (timeSinceLastAttack > timeBetweenAttacks) {
animator.SetTrigger("attack");
timeSinceLastAttack -= timeBetweenAttacks;
}
instead of
timeSinceLastAttack = 0;
This way we would keep track of the surplus of seconds from the latest frame, wouldn’t we? I fear that this time excess could be important in some future development, or am I just being too paranoid?