Melee Attack Combo Transitions

Chobo

New member
Good morning,

I am trying to setup a simple 1 / 2 combo attack like the left then right slash melee attack combo found in the TPS demo scene.

When the "Use Complete Event > Wait For Animation Event" option set and I attack, the first attack animation is played but will not transition and play the second attack animation until the complete event of the first attack has fired despite the "Allow Attack Combos" option being set.

If I disable the "Use Complete Event > Wait For Animation Event" option and use the "Duration" value of 0.05 the attack transitions work correctly.

I assume that combo attack transitions are supported given the "Allow Attack Combos" tooltip stating that the next use state animation can play in the window between the use and complete animation events.

Context:
I have used the sword sub state machine in the third person animation controller as an example.
I am using root motion animations for both of my attacks.
I have "Use Event > Wait For Animation Event" option set.
I have the "Use Complete Event > Wait For Animation Event" option set.
I have the "Allow Attack Combos" option set.
I have the "Force Root Motion" option set.

What I have tried:
I have read the animation and melee weapon documentation and looked at the demo scene setup.
I have setup the "OnAnimatorItemUse" and "OnAnimatorItemUseComplete" events for both of my attack animations.
I have setup the correct transitions from each of the attacks in the animation controller as per the examples using the correct item index and item substate index values.
Ensured the "Allow Attack Combos" option is set.
Set the item use rate to be 0 to rule it out.
Added the correct item substate index values in the "Animator Audio States" list on the melee weapon component and set the "Allow during movement" option (not sure if that is required as I'm using root motion animations)

What I know:
I can see the transitions working correctly in the animator window.
I can see the use and complete animation events firing correctly when I enable debugging.
If I disable the "Use Complete Event > Wait For Animation Event" option and use the default "Duration" value of 0.05 the first to second attack transition works correctly.


Please can someone help me understand what I have missed or am doing wrong?
 
Just so we are on the same page, the demo scene works correctly for you, correct? Have you switched out the animations? If you have not switched out the animations then it's likely a setting on the MeleeWeapon component so you could try comparing your values to that.
 
The demo scene works perfectly.

Yes I have swapped out the animations but I have enabled debugging and can see the use and complete animation events firing in the console for my new animations.

If I use uncheck the "wait for animation event" option for the use complete event and use duration then my combo works fine, this suggests its an animation event issue?

I'll compare my new weapon to the MeleeWeapon component settings in the demo scene again.
 
If I use uncheck the "wait for animation event" option for the use complete event and use duration then my combo works fine, this suggests its an animation event issue?
It would suggest that, yes - if you're using custom animations then you may still need to add the appropriate animation events to that animation's timeline, which you can do in the inspector (click on "Edit" with the animation selected).
 
As mentioned above the animation events are there and they are being fired according to the debug logging shown in the console.
 
Top