How to change the parent class of a cpp class?

What am I supposed to do if I want to change the parent class of my UCLASS cpp class?

( I guess it won’t work If I just change the parent class name to another )

I also have some blueprint classes derived from the cpp class.

It will work, note that C++ in UE4 is full flage C++ and UE4 don’t really have much supervision over what native code in C++ is doing , most issues related to that is UE4 don’t expecting what you code will do and cause data corruptions instability and crashes.

So if you change parent in, it will change it and UE4 will follow it. Remember to also change includes in header file, to include header file of new parent.

Now doing that will cause issues with blueprints, by reparenting C++ you will technically reparent all related blueprints (and C++ classes too) and the safest way is to remove all nodes that depends on fact that class is parent of specific class before reparenting in C++ and once that done reconnect them back.

Even safer is to make 2nd class with same functions and code, then reparent blueprints to new class and then remove old class