I’m trying to convert my BP_GameAIController blueprint (subclass of AIController) to c++ code. I’m really new to unreal c++ programming so I need a little help.
I have a function named AIGetTargetGameChar that gets an object from the blackboard like this:
I created an AIController subclass, added the AIModule to the Build.cs file.
My Behavior tree and blackboard is created using the Editor.
How sould I create a function like this in code? I noticed there is no GetBlackboard function available.
Is there an good i tutorial in c++ available? I could not find one.
If you want to work with C++ I strongly suggest you started looking for functions in header files first. Blackboard getter you’re looking for is UAIBlueprintHelperLibrary::GetBlackboard. If you’re using launcher versions of UE4 you won’t be able to look at the implementation details, so I also encourage you to get full sources from github for the sole purpose of reading code. If you read UAIBlueprintHelperLibrary::GetBlackboard's implementation you’d find out that it boils down to calling FindComponentByClass() on pawn’s controller.
Happy reading and welcome to the demanding yet satisfying world of UE4 C++ coding!