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…
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.