hovgaardgames
New member
Hi, I am having a problem with my behavior tree, I get a huge lag spike every time is enabled, as you can see in this image:
It seems that the problem is in the deserialization of the tree, so I read in other posts that the solution is to pool and call the Init function of the external trees before actually calling to the EnableBehavior function. So, I made this to try it:
However, it is not working, all the heavy load is being carried by the EnableBehavior function. Seems like the Init function is doing nothing. The tree has multiples behavior references that have more behavior references inside. Is that the problem? And if that's the case, can I do something to solve it? Thank you.
It seems that the problem is in the deserialization of the tree, so I read in other posts that the solution is to pool and call the Init function of the external trees before actually calling to the EnableBehavior function. So, I made this to try it:
However, it is not working, all the heavy load is being carried by the EnableBehavior function. Seems like the Init function is doing nothing. The tree has multiples behavior references that have more behavior references inside. Is that the problem? And if that's the case, can I do something to solve it? Thank you.