Hi there!
I have a Combat Script with multiple skills.
My issue is knowing which skills animation ended.
Lets say I have 3 skills :
Punch, Kick, and Mega punch.
If I Punch, I will start the punch animation, and at the end of the animation, I want to call a function in the skill itself to stop the skill.
My issue is, my animation doesn’t know which skill called it.
Like If I punch, I use the punch animation, but Megapunch also use the punch animation.
To get over this, I keep the last used skill in a variable. So when the punch animation end, it check the lastSkill variable and knows it was the punch skill that triggered it.
Alas, it doesn’t work when I cancel an attack with another.
Punch can be cancelled by Kicks. When I start Kicks, it transition the animation from punch to kick. The thing is, by the time kick started and is now the lastSkill used, Punch will end it’s animation and call the Stop skill function. Sadly, lastSkill is now Kick, so it stop the kick when it should stop the punch.
I’m a bit stuck, I don’t know if my explanation are clear or not.
Thank you!