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"

Unable to cast from parent class to child class BP's

Hey, I am currently trying to use certain BP's and have to use a cast more specifically this is a cast from parent class to a child class but the cast fails. I am posting certain images which might be able to help with the problem for more clarity i am trying to attain something like this :

 class A
     public :
       void print()
         cout<<"A Here";
 class B :public A
     public :
     void print()
         cout<<"B Here";
 int main() {
 A* a = new A();
 B* b = (B*)a;

This works fine in c++ but i am having issue's with BP's Here's some picture's for reference. alt text

alt text

alt text

Product Version: UE 4.18
1.png (124.0 kB)
2.png (97.7 kB)
3.png (33.7 kB)
more ▼

asked Dec 01 '18 at 02:03 PM in Using UE4

avatar image

66 3 6 7

avatar image KristofMorva Dec 01 '18 at 03:54 PM

MyAIController is a child of AIController, right? Are you sure that the Controller is not pending kill or something, so that GetController->IsValid is true?

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

0 answers: sort voted first
Be the first one to answer this question
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