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"

error C2440: 'initializing' : cannot convert from 'UBlackboardComponent *' to 'UObject *'

Am getting this error:

 error C2440: 'initializing' : cannot convert from 'UBlackboardComponent *' to 'UObject *'

For this line

 BlackboardComp = PCIP.CreateDefaultSubobject<UBlackboardComponent>(this, TEXT("BlackboardComp"));

Worked on a tutorial i was watching so have i made a typo anywhere??

Product Version: Not Selected
more ▼

asked Sep 09 '14 at 11:44 AM in C++ Programming

avatar image

57 27 18 21

avatar image Pierdek Sep 09 '14 at 11:47 AM

Show declaration of BlackboardComp from an header file.

avatar image Green_ Sep 09 '14 at 12:22 PM
         TSubobjectPtr<class UBlackboardComponent> BlackboardComp;
avatar image Pierdek Sep 09 '14 at 04:52 PM

No clue, the code looks the same as in ShooterGame, are you sure this the wrong line ?

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi Green_,

Do you have the following line in your .h file?

 #include "BehaviorTree/BlackboardComponent.h"

If you are following the tutorial I think you may be following, you will most likely also need to use

 #include "BehaviorTree/BehaviorTreeComponent.h"

Also, you should be using Transient instead of transient. I believe that was changed recently.

more ▼

answered Sep 10 '14 at 07:19 PM

avatar image Green_ Sep 11 '14 at 08:13 AM

Yep this fixed it, thank you. Why do i have to import these? Are they not included already?

avatar image Tim C ♦♦ STAFF Sep 11 '14 at 07:59 PM

In order to improve performance, the Engine no longer includes everything automatically. The more commonly used classes are still available, but you may find yourself needing to include specific header files occasionally.

(comments are locked)
10|2000 characters needed characters left
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