ActionTask Execute OnUpdate execution order

NodeCanvas Forums Support ActionTask Execute OnUpdate execution order

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11128
    feelx
    Participant

    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?

    #11134
    Gavalakis
    Keymaster

    Hello,

    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?

    Let me know.
    Thanks,

    Join us on Discord: https://discord.gg/97q2Rjh

    #11137
    feelx
    Participant

    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!

    #11141
    Gavalakis
    Keymaster

    Ah, I see.
    Thanks for letting me know. 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.