LogBehaviorTree:Warning: OnCeaseRelevant called on Blueprint service None with invalid owner. OwnerComponent: BTComponent, OwnerComponent Owner: BP_AIVehicleController_C_0. OwnerComponent has BeginDestroyed flag
Just to add on to this, I find it good practice to destroy the controller before the pawn. simply because a pawn can exist for an extra frame without a controller if it’s really required but you can get errors if your controller tries to run logic on your pawn and it does not exist anymore.
Mieszko and Justin, thanks for replying.
Now this may be a stupid question but I am not able to find “Brain component” in AIController. Is it only on c++ side now? When I search for brain component in blueprint, only thing its giving me is “Cast to Brain component”.
Please let me know what I am doing wrong here.
This error message happens during normal destruction of AIController with running BT (for example, when Stop is pressed in editor), so I think it is an engine bug.
Mieszko, I created a simple project that reproduces this bug. Just open it in editor and press Play/Stop. As you’ll see in comments in BTService.uasset, there are actually two bugs related to NotifyDeactivation:
OnCeaseRelevant isn’t called unless BTService implements NotifyActivation. Why? Maybe I don’t care about activation, I only want deactivation callback.
NotifyDeactivation isn’t called when Stop is pressed.
So, looks like BehaviorTreeComponent::Cleanup isn’t properly doing what it is supposed to do.
commit e0acca6e4614bbe4b88ab75da683698497c33987
Author: Lukasz Furman <Lukasz.Furman@epicgames.com>
Date: Fri Dec 19 05:52:26 2014 -0500
added OnTaskFinished event to behavior tree task nodes,
always calling OnCeaseRelevant and OnTaskFinished on active nodes when tree finishes (restart / end play)
[CL 2393632 by Lukasz Furman in Main branch]