If you declare a bool at the top of your script, you can then use the bool as a switch.
An example will probably be clearer.
//Pseudo code
bool damageDone = false;
if(animation["AttackingPlayer"].time >= 0.6){
if(!damageDone){
RayCastFunction();
damageDone = true;
}
}
Once your animation has finished, set damageDone back to false and you start again.
↧