hi, Justin
I am running the behavior tree designer now, I have no issue with the event sending and receiving, but once it is combined with the sequence abort function, I am confused.
here I simplified the issue with the Iskeydown and sequence nodes.
the tree is set as run endless, and the sequence node set as "Both" abort type.
In tree A , once I press the key, it will log out "B" first, then log out "A", in my understanding after the tree aborted, it runs from Iskeydown node to LogB, but why there is one more logA executed after logB node? I expect the Iskeydown should only abort the sequence once, but it looks abort twice.
I tried more and found that in treeB once I press the key to abort the tree, the tree only runs LogB node to print out "B", doesn't execute logA node anymore. but it will stop at the Wait node, I tried to replace the Wait node to any other task nodes, it always stops at the second node from the IsKeydown node. I don't understand why this could happen.
I read the IsKeydown node code, it looks like the tree checks the IsKeydown condition in every update, once it is not pressed, then it will return failure. So I am guessing that when I press the key, the tree aborts and run from the sequence. but in the next update, the Iskeydown condition is failure already, which aborts the sequence node to run over again.
how to make the event trigger node just acts like a normal event in code which only run once when it is triggered?
thanks.
I am running the behavior tree designer now, I have no issue with the event sending and receiving, but once it is combined with the sequence abort function, I am confused.
here I simplified the issue with the Iskeydown and sequence nodes.
the tree is set as run endless, and the sequence node set as "Both" abort type.
In tree A , once I press the key, it will log out "B" first, then log out "A", in my understanding after the tree aborted, it runs from Iskeydown node to LogB, but why there is one more logA executed after logB node? I expect the Iskeydown should only abort the sequence once, but it looks abort twice.
I tried more and found that in treeB once I press the key to abort the tree, the tree only runs LogB node to print out "B", doesn't execute logA node anymore. but it will stop at the Wait node, I tried to replace the Wait node to any other task nodes, it always stops at the second node from the IsKeydown node. I don't understand why this could happen.
I read the IsKeydown node code, it looks like the tree checks the IsKeydown condition in every update, once it is not pressed, then it will return failure. So I am guessing that when I press the key, the tree aborts and run from the sequence. but in the next update, the Iskeydown condition is failure already, which aborts the sequence node to run over again.
how to make the event trigger node just acts like a normal event in code which only run once when it is triggered?
thanks.
Last edited: