Hai, my name is riady and this is my first post.
I am currently working on a RPG game and i have a problem making a multi hit animation.
Here is my code :
for (int hit = 0; hit < 3; hit++)
{
yield return new WaitForSpineEvent(transform.FindChild("0_Skill").GetComponent<SkeletonAnimation>().state, "Damage_"+hit);
//Debug.Log(hit);
target[targetID].GetComponent<HeroController>().ReceiveDamage("MAGICAL", DAMAGE[targetID], name, hit);
}
Basically, what i am trying is to wait until event ("Damage_" + hit Index) then apply damage to target and repeat.
The problem is the yield stuck and the apply damage method not running.
Also i try to debug my "0_Skill" events name and strangely it showed :
"Damage_1"
"Damage_2"
"End"
the result i expected should be :
"Damage_0"
"Damage_1"
"Damage_2"
I had also tried wait until event ("Damage_" + (hit Index+1) since the debug log start from 1 and it worked for the first damage but then it got stuck again.
Also if you have better idea for multi hit animation please share it to me.
Thank you, Riady.