FSM Node that runs parallel to a state

NodeCanvas Forums Support FSM Node that runs parallel to a state

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #16456

    Hello !

    So I’m using Node Canvas FSM trees, which I love, but I can’t quite figure out how to get this simple idea working :

    Let’s say I make a barebones state with the Seek Vector3 Node. Now, I want to constantly update an animator parameter so that it matches the NavMeshAgent velocity -> I made a simple custom task for that, and I run them both in parallel. So far, so good. The thing is, onFinish never gets called, as my custom node essentially has no end (it should run indefinitly until the other tasks in the state are complete), and I would simply like to exit the state based on that Seek Node completion. I feel like I’m probably missing something, or taking that problem through the wrong end…

    Anyway, thanks a lot for the help !



    My guess is that onFinish is never called in your custom task because you need to notify NodeCanvas that the action has been completed by calling the EndAction() method.



    Indeed. Since your custom Action does not finish (EndAction call), the state is keep running indefinitely. To break out of the state in this case, I would recommend using a condition on the transition (like a custom destination reached for example).

    On the other hand, if your call EndAction in your custom action it will only execute once. There is a “Repeat State Actions” option to repeat the actions once they have finished, but currently this resets the actions once they are ALL finished. I could add an option there to reset/repeat the actions in the list as soon as they are each finished. To achieve what you want however, there will need to be another option there in case the “Repeat State Actions” is enabled, to select to either (example text) “Repeat Indefinitely”, or “Repeat Until Longest Action Is Finished”. This of course needs some work to add, but am I on the right track of what you want to achieve?

    You can always of course just create a custom action that does both the Seek and the update animator parameter in one so that you have full control of the action execution :). You can for example duplicate the Seek Vector3 and modify it to also do what your custom action does while it is seeking the target.


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

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