Arrays not work with behavior tree

I created an array inside the char that is owned by the AI ​​controller. After that, I created a task within the behavior tree, which uses this array.

The problem is that it does not execute the loop, as its size is not valid. Even though it is filled with values ​​within the Char.

Print the actor name where you add the value to the array (use self node) and “Controlled Pawn”. Are they the same actor? I’d guess not.

1 Like

Sorry, I don’t quite understand where this path should lead, since the self would not receive the char as a reference, but rather the behavior tree itself or the AI ​​controller. So the path would be longer

In fact, I’m asking through the cast if the character receiving the ControllerAI is a HumanEnemy (which has the storage variables). If true, the cast will be successful and will continue. What actually happens, the entire execution works, but the result is always empty.

If not, would you be able to explain the order of parental reference for each element you are talking about?

I think I found the problem. Apparently, the task only updates the internal values when it runs. I read that the task is not being destroyed in a run (this was in another thread). So either I create an internal event inside the char and execute it with the behavior tree or I create a separate check for the behavior tree to trigger the task. I’ll test it

I think I found the problem. Apparently, the task only updates the internal values when it runs. I read that the task is not being destroyed in a run (this was in another thread). So either I create an internal event inside the char and execute it with the behavior tree or I create a separate check for the behavior tree to trigger the task. I’ll test it

Observation:

Regarding my statement above about how the task works, I don’t know if it really is like that, but the method I used managed to execute the variable

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.