Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to get a Blackboard Object in C++?

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:

alt text

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.

Thank you.

Product Version: Not Selected
more ▼

asked Jan 29 '15 at 03:17 PM in C++ Programming

avatar image

677 33 106 127

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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! :D



more ▼

answered Jan 29 '15 at 03:27 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image Ghar Jan 29 '15 at 03:31 PM

Cool, thanks a lot.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Most nodes are real functions in C++ so you can find them by searching in API refrence


It's a static function so you should call it UAIBlueprintHelperLibrary::GetBlackboard(SomeActor);

more ▼

answered Jan 29 '15 at 03:32 PM

avatar image

36.5k 930 169 1111

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question