Animation Events + Equip

Szymon Z.

Member
Hi.
We have small problem with equipping and animator.
Our items are using the WaitForAnimationEvent and WaitForAnimationEventToComplete for unequip items.
Overall that works fine, events are set in animation, they are executing, logic works.
However, if we have a simple state let's call it:
Unequipp_Axe
and then we have both events, the state is repeating once every time.
That means:
0 events on timeline -> no repeat of state (state is not transit to itself)
1 event (OnAnimatorItemUnequip) -> no repeat of state
2 events (OnAnimatorItemUnequip + OnAnimatorItemUnequipComplete) -> The state is playing, once he reach moment of Complete, that starts to play again (same state).
Fun fact, once the state is played second time, there is no more loop. So this is only one repeat and only after first Complete.

Do You have any idea why that can be like that ?
That breaks how animations looks because once the state is starting to play again from the mid of itself, that just looks odd
 
I had this issue. I set all wait for animation events on the items animator to 0. Also Stop use ability on complete delay and also use rate set to 0. Never had animation problems after that. I guess you can increase values after its working to refine and set any specific delay.
 
If it doesn't repeat a second time it sounds like it's a race condition between the animation event and the transition. You could try placing the animation event a little bit sooner to see if that helps at all. Alternatively just to test things out you could also use a timer to help debug.
 
If it doesn't repeat a second time it sounds like it's a race condition between the animation event and the transition. You could try placing the animation event a little bit sooner to see if that helps at all. Alternatively just to test things out you could also use a timer to help debug.
the sooner complete event appears, the sonner repeat starting. That's related exactly to that point.
Is it something happening in code what can trigger animator to play the same state ?
As transition to self is disabled for that state, i suspect that should be something in code what can trigger that state again.
Maybe worth to add -> this is related also to Equip animation event, that state also start to repeat at the moment of reaching Complete event
 
There isn't anything in the code that knows anything about the animator state that you are in. All the character controller knows about are the parameters. If it's repeating again you should check what the parameter values are that are causing it to repeat. From there you can look at the transitions to understand what transition is causing the repeating.
 
Top