Hi,
I’ve implemented an action that waits for a mecanim animation to be over.
What I would like to do is cache the animatorStateInfo for the state the animator is in the moment my action is executed.
So OnExecute should be the right place for this right?
In OnUpdate I would then check for the animation to be finished and call EndAction(true) when finished.
Somehow it seems though OnExecute gets called beFORE this action is executed, resulting in my cached state info having the wrong data (wrong state).
So basically this boils down to the question:
The basic flow of the execution order would be OnExecute once and before OnUpdate and then OnUpdate until the action is finished?
Yes the order of execution is indeed, OnExecute once and only after that, OnUpdate until the action is finished by an EndAction call.
Many included actions also do use OnExecute for caching some data and OnUpdate to make use of them, just like you are trying to do.
Maybe there is something else going wrong here? Is this custom action relevant to Mecanim the only one you have issues with, or there are others as well?
Hi,
thanks for the confirmation.
The reason for this not working is mecanim still transitioning to the other state when checking, so actually being still in the wrong state.
So NC working as intended – this should be easy to fix on my side.
Cheers!