I’ve include an exemplar project to better show what I have with NodeCanvas and what I actually desire (achieved via code only). To recap I am using Unity Events and basically want to capture all the events fired, but I’m only capturing the last event fired in a frame (update)?
IntEvent (NodeCanvas) invokes 10 and 5 per frame. But only logs the 5 in every frame.
AnotherIntEvent (Code) invokes 0 and 1 per frame. It logs both the 0 and 1 in every frame (Desired result).
I am really sorry for such a late reply! :-/
Also thank you for providing an example project that helps me understand what you mean.
Unfortuantely, what you want to achieve, is not really possible in the context of Behaviour Trees. The reason behind this, is simply because a tree is only updated once per frame, meaning that a tree traversal, can at most happen once per frame.
What is happening here, is that the condition task (IntEvent) is checked, and as soon as it is raised, execution passes on the the action task (Log). As soon as the action task is also finished (within same frame in this case), the tree traversal is done and the next tree traversal will only happen on the next frame. As such, no matter how many times the event is raised within that one frame, it is only really checked once.
It is undefortunately something that is not really possible to transfer from code and within the context of behaviour trees to work in the same way.
Please let me know if the explanation/reason why makes sense, or if you want to elaborate further.
Thank you and once again sorry for the late reply!