I’m here to ask two questions: 1) if the contents of an Array Variable within a task resets per run of the behavior tree and 2) if the value of a Blackboard Key resets per run of the tree.
I’m asking because while my code initially works, it boggles me how to works a 2nd time if no target points within range.
So in this task, I’m searching for possible target points within a radius with a certain vector as the center. I get every single possible target point of this map and check each of them. If they are within range, I add it to an array of target points to check later. Once all the points have been checked, the next part checks for the length of the array of target points; if the length is 0, print a statement and DON’T save a blackboard key as a moveTo point.
The problem I have is as follows. When there are no target points to moveTo for the Pawn, the array of targetPoints should be empty. This is shown as print statements NOT IN RANGE in the picture below.Yet, the AI Pawn still moves to a point despite not being supposed to. The circled box(es) is where I add elements to the array and check the length in order to figure out what to do next. Since the array wasn’t empty(apparently when it should have) the code took the first point in the array and set it as the default moveTo point in the Blackboard.
I’m leaning towards the issue that the contents of the array ain’t resetting. Is this the case?!