Melee Simple Combo Use Complete event not getting fired sometimes...

Hello,

I have set up up dual swords (similar to Princ of Persia The Lost Crown) and am trying to set up an attack combo. To do this, I have a Use item ability set up with SlotID -1 to allow both swords to be used at the same time. The swords are prefab variants deriving from a base prefab which has the melee action component on it. (The variants are set up correctly with different slot IDs etc to differentiate them, but same Item ID). Now when setting up the combo, if I use only durations for the event triggers (use, attack start, attack complete, allow chain attack, use complete) and do not wait for any animator events, then the combo works ok 80-90% of the time, with the remaining 10% being that the final slash in the combo executes after a strange delay, but it still finishes. However, if I wait for animator events, the use complete event simply does not fire on occasion after either the second or third slash in the 3-slash combo, and the item state and substate just gets stuck, and the animator never transitions back to Idle, or any other state. What might I be doing wrong, or has anyone else faced this issue and resolved it? I can't seem to set up a smooth combo!

PS: Just FYI, the order in which I have set up the events in each animation timeline are as follows - Use -> Attack Start -> Attack Complete -> Allow Chain Attack -> Use Complete. Not sure if this flow is incorrect, but just putting it here for info
 
Animation events trigger based off of the animation so my guess is that your animation is transitioning to the next state before the event can fire.
 
Yes, I did some reading on this. Seems that if I speed up the animation using the animator instead of the actual clip itself, this could cause issues in transition timing and animator events. Is there any way I can get around this to guarantee animation events firing, or would you say that calculating and balancing duration values would be a more reliable approach for setting up my combos?
 
calculating and balancing duration values would be a more reliable approach for setting up my combos?
That is definitely a more reliable approach. Especially with blending two animations I've noticed that animation events can be iffy.
 
That is definitely a more reliable approach. Especially with blending two animations I've noticed that animation events can be iffy.
Hey Justin, thanks for your response. I tried to use a combination of events and durations (I used events for the Use event and Attack Start event and durations for attack complete, allow chain attack, and use complete). It works ok if I tap the input in a controlled manner, but if I button mash it the animator still gets stuck - I noted that it is because of the animator parameters. The use ability 'uses' items in both slots (SlotID = -1 because this is a dual sword attack and I need attack actions for both swords to be triggered) but my transitions have been set up with conditions only for Slot1 parameters since I assumed both slot0 params and slot1 params would be set at the same time since the ability setup uses both. However, sometimes, only the slot 0 parameter are set (when the input button is button mashed) and this causes the animator state to get stuck since there is no corresponding slot 0 conditions to enter the next state. Any advice on how to handle this situation better?
 
Hmm, that gets tricky to debug. Are you able to reproduce the same problem in the demo scene?
 
No I couldn't reproduce this in the demo scene - but that's because the swords in the demo scene are single swords right? Not dual swords like mine, so there is only ever one slot ID for the animator to use for the transitions. I tried something else on my end - I created 2 transitions for each of my combo states - one which uses slot 0 parameter, and one which uses slot 1 parameters, and I disabled 'Can Transition to Self'. This still caused some issue of state 'double playing' on occasion, so I set each of the transitions to 'solo'...it made the issue WAAAYYY better. It still gets stuck on occasion - I noticed this happens when I mess with the use rate. If I set it to too low a value, the issue arises on button mashing. Does this info help you point me in any further direction? Haha
 
hmm, if the state is double playing it sounds like a transition is occurring that you don't necessarily expect. On the Animator Monitor you can enable logging which will help point to what parameters are being set so you can then adjust the transitions.
 
Top