Download

AI Controller Made using C++ does not Run MoveTo Tasks.

Hi, I made an AI Controller Class in Cpp and in its begin play function i used AAIController::RunBehaviorTree(MyTree);

I also Log in case if Behavior Tree is null.

Thing is if i make an AI Controller using BP and do exactly the same my AI Character performs all the tasks and works perfect but everything stops working if the AI Controller is made using C++ I even tried making derived BP from my C++ AI Controller and it still does not work.

EDIT: I assume i am missing some boiler plate code i can share my code if anyone wants.

hmmm… perhaps you need to make sure the correct AIController class is selected for your AI pawn? Also, if you only have BeginPlay() in c++ make sure there are no derived BPs of it that you don’t need and are are somehow still in use and for which you still have an EMPTY BeginPlay node. I think there might be an override issue there. Not 100% sure I’m accurate on this, but just to be safe.
Hard to understand your problem without more details.

I have subclassed the AI controller and the all works fine. Make sure you call the parent method from any methods you override. ie, Super::

Oh My God I have been making this mistake this whole year and it just never crosses my mind kinda feel stupid now.

Thanks I forgot to call Super in begin play function inside the C++ class.

Most welcome. If you are not feeling stupid while programming, you aren’t learning new things. I keep telling myself this my entire journey with UE.