Hi,
I’m currently working on tags/4.3.0-release and I’m getting crash when I try to change the current behavior tree from a controller event, this doesn’t happen 100% of the times, but almost…
I found that TaskInstanceIdx is -1 in UBehaviorTreeComponent::OnTaskFinished, so I guess there was a pending task on the old BT calling OnTaskFinished and, as you are already returning if “TaskNode == NULL || InstanceStack.Num() == 0 || IsPendingKill()”, I just added “if (TaskInstanceIdx == -1) return;” after “const int32 TaskInstanceIdx = FindInstanceContainingNode(TaskNode);”, it seems to be safe, the crash is gone but I’m not sure if this will leak memory.
Can I keep this fix? or do I have to change the behavior tree only from the previous one and not from the controller blueprint?
Additional information: All my BT tasks are BP, I’m using parallel nodes to walk and aim/attack at the same time, the controller may change the BT on some movement events
Thanks,
Leo Benaducci