Currently, I am trying to get PIBot’s (a character in my game) Behavior Tree to function as intended, it looks like this:
The tree initially, upon testing in editor, does seem to work, but even if the EPIBotCurrentStatus blackboard key (an enum), is equal to ‘SacramentoIsNoThreat’, the centre path, where this blackboard based condition to run the task under it is on this Behavior Tree, it is never executed, I will give a sample of testing this in editor just below:
Sample run to test this Behavior Tree
Upon loading QTBDIntro, the level where this Behavior Tree can be tested, looking at the Behavior Tree sub-editor, shows this:
This is what the state of the Behavior Tree should be, upon loading into QTBDIntro.
When pressing ‘L’, for a shortcut I have in place for testing, the state of the behavior tree changes to as such:
Then Sacramento (another character in my game), gives the first line of dialog for their introduction, when this finishes, PIBot will tell the player that they will be teleporting away, to hide out of sight from Sacramento, as they perceive him as a threat, when this occurs, the state of the Behavior Tree changes to this:
Then, if the player causes Sacramento to become friendly towards them, PIBot will teleport back near the player and should start following them again, however, this is not the case, as shown below:
So even though the blackboard enum is the correct value and so, as the tooltip indicates, should pass the condition for the middle node of the Behavior Tree, still treats PIBot as though it is not this value and is still hiding from the Sacramento, this can also be seen to the bottom right of the 5th screenshot, where all of the blackboard keys and their values are displayed.
So therefore, can anyone help me with this issue? Do Behavior Tree Blueprints not work in quite the manor I expect and believe they do?
Please do tell me if I am missing important features from this Behavior Tree, I would like to know what the issue(s) is/are.
Edit: I have added an additional Blackboard Based Condition to the centre node, to check if ESacramentoStatus is not equal to ‘HideFromPIBot’, as well as checking if it is equal to ‘SacramentoIsNoThreat’, when simulating, the test passes (according to the tool tips), once again, but still runs the right hand side third node, as before, for PIBot hiding from Sacramento.
Edit: I have modified a service of PIBot’s Behavior Tree, to update a member var. of PIBot’s to be correctly in sync with his current state blackboard enum, this also cause the same results to be produced though, unfortunately.