How can I reparent blueprint parent class in C++?
Hi, I want to know how can I reparent blueprint parent class by code the class of a blueprint asset like in class settings in the blueprint viewport, like the picture below but in C++:
Thanks for the help in advance.
I interpret your question as:
In C++ code, you have two base classes: BaseClassA and BaseClassB.
DerivedClassC is derived from BaseClassA.
You want DerivedClassC to be a child of BaseClassB instead.
If that is a correct interpretation then in the existing DerivedClass.h header will be a line:
Class DerivedClassC : BaseClassA
If you change the reference from BaseClassA to BaseClassB then you will have successfully re-parented the DerivedClassC.
You will then have to ensure that any existing code you have written elsewhere that uses BaseClassA functionality when dealing with instances of DerivedClassC are updated if that identical functionality and call signature does not exist in BaseClassB.
Also any variable declarations, template calls ("") and casts ("= (BaseClassA)") etc. would need to be updated to refer to BaseClassB.
Could be a messy task if you are editing a big project.
answered Aug 11 '19 at 03:20 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here