Animator parameter reset delay

Lavos

Member
Hi,

I am trying to set my animation controller to work with the ultimate character controller. I want my character to be able to jump as soon as he finishes his last attack.
It does not work right now and I think the problem is that the animator parameters are not reset as soon as the attack finishes, which prevents the jump ability from triggering. In particular, the Slot0ItemStateIndex takes about 1 second after the last attack finishes to reset from 2 to 0.
I have had a look at the code and maybe my problem is coming from this part in UltimateCharacterLocomotion.cs :

1611076532515.png

In my case, the immediateUpdate bool is probably set to false, which delays the parameter reset. I am really not sure at all though... :)
I cannot find a clear explanation from looking in the code and my search on the internet was unsuccessful too.
Certainly, there is a reason for this delay to happen. Could you please help me?
 
Animator parameters (like the item state index) are changed as a result of events, sent either from the animation itself or the item action. In the relevant item action component, e.g. ShootableWeapon, you can define if the action should wait for the animation event or trigger it after a fixed amount of time. So you may want to decide not to wait for animation events and set the duration to 0 (for the Use Complete Event).

If you want to use the animation event, you can view the events an animation sends by opening up that animation in the inspector and scrolling to the bottom, where there is a timeline view of when each event is sent - you may in this case want to bring back the OnItemUseComplete event to be earlier.
 
Thank you Andrew for your detailed answer. I have already made these settings and everything works pretty well including combo attacks except for this parameter reset delay. If you look at the gif below, you will see that the Slot0ItemStateIndex parameter resets almost 1 second after the end of Attack01.

ParameterResetDelay3.gif

Here is the associated melee weapon config :

1611162244242.png

FYI, I was able to remove the delay by setting a use complete duration of 0 AND by setting the speed of the animation to 1. If the animation speed is 1.7 (as it should be) I have the delay. If I use the use complete event without duration, I always have the delay no matter what I try...
Any idea what is going on?
 
So you can't use the animation event and bring the OnUseItemComplete event further back in that animation's event timeline?
 
OnUseItemComplete does not seem to work for me (the attack keeps looping and never ends) so I use OnAnimatorItemUseComplete as said in the editor tooltip. If I set the event to the very beginning of the animation, the delay after the end of the animation becomes shorter but still remains. It is as if the OnAnimatorItemUseComplete event was triggered 1 second after my settings, no matter what I try... It really seems like a bug or hopefully a big configuration mistake on my side.
Also even if I set the event earlier to offset the delay, my combo timings are going to be disrupted, right?
Do you think there could be a better solution?

In case it helps, here are my normal animation event settings :

1611242046914.png
 
Last edited:
OnAnimatorItemUseComplete is correct. Where did you see a tooltip that said OnUseItemComplete? I just did a search and didn't get any results back with that string.

Regardless, you can enable logging on the Animator Monitor to see when an event is sent. As soon as the frame is updated the parameter is also updated. The dirty flag prevents the parameter from being updated in the middle of execution which can cause some race conditions with other abilities. If you haven't seen it this page provides a good explanation for how combos work:

 
Hi Justin. Thank you for your help. I think OnUseItemComplete was just a misspell in Andrew's answer. Not a big deal.
Enabling logging is pretty useful indeed. Here is what I get :

1611325648179.png

You can clearly see that there is a 1 second delay between the OnAnimatorItemUseComplete event and the reset of Slot0ItemStateIndex. Is this the normal behavior? My problem is that during this 1 second delay my character cannot jump, which feels very annoying and unnatural because there is no reason for the character to be stuck on the ground during this 1 second. He cannot jump because the jump animator parameters (ability parameters) are not updated as they should be when I press the jump button during the delay. Could you please help me?
 
Setting the Stop Use Ability Delay to 0 solved the issue! No more delay.
I am new to Opsive so I still have to discover all the parameters and functionalities but I could have wasted days on this one. Thank you for not letting me down, I appreciate it. :)
 
I'm a little late to this conversation, but setting the Stop Use Ability Delay to 0 solved this same issue that I have been encountering. It would have been very helpful if this information was located somewhere in the documentation as I see Justin direct other related threads towards that page on the Combos section of the Melee Weapon page.
 
Top