Blueprint could not be loaded because it derives from an invalid class

I added a C++ class to my project via the File>Add Code to Project menu. I made a Blueprint which derives from the new class, and everything works perfectly. Until I restart the editor. When I try to open the Blueprint after restarting the editor I get this message:

Blueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for this blueprint hasn’t been removed!

The Blueprint fails to open, and right clicking on the offending Blueprint in the content browser crashes the editor. Every time I delete the Blueprint and create it again from scratch it works fine until I restart the editor again. Does anyone know what’s going on?

1 Like

I made a new class and copy pasted all my code over. I still don’t know what happened but at least it works now. So this is solved then.

1 Like

Sounds that parent class or this class got corrupted

Hi TickleForce,

I just wanted to check in and make sure everything is working fine for you now. Do you still need any help with this issue?

Yes it works fine now, thanks. I still don’t know what caused my class to become invalid when I restarted the editor, but creating a new class and copying the code over solved the problem.

I have exactly the same problem (4.6.1). It would be nice to understand why it is happening and what triggers the problem.

Hi Gastel71,

Sorry for the delayed response. Do you still see this happening? Is it limited to one specific class?

Hi ,

it happened to me twice, but I have no clue on how to reproduce the issue. Re-creating the blueprint from scratch solved the problem. It only happened on blueprints derived from c++ classes so my suggestion is to look for a “bug” related to how c++ objects are referenced when deriving a blueprint but I understand that finding a non-reproducible bug is almost impossible in an architecture as complex as UE4’s one.

I will be keeping an eye out for this, but if you happen to see it again, please let us know.

This is happening to me on UE5 and it already happened twice in a row.

9 Likes

Blueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for this blueprint hasn’t been removed! Do you want to continue (it can crash the editor)?

This is happening nearly every time I start UE5… driving completely bonkers at this point…

7 Likes

This happens if the c++ class is renamed and you forget to add a Core Redirect, which is why the Blueprint system will not be able to find its parent.
This situation is pretty much always explainable and simple to solve.

If it’s a Blueprint class complaining about its parent class which is also a Blueprint class, you might be dealing with some form of corruption. In that case, if the editor does not allow you to set a new class you could attempt to by using this tool:

4 Likes

Hi , I started using UE5 and EVERY TIME i close and re-open the project i have the same issue, all my blueprints derived from C++ classes can’t be opened. I looked for a solution on Google and the only thing once worked was renaming the class: from “CPP_Character” to “CPP_MySubject” , because they told me that UE5 let you use names already in use internally and when this happen the blueprints you create with that class, crash the next time you open the project again.

But this doesn’t seem to resolve the issue. I did this few times, sometimes works, sometimes not.

Since happens everytime to me, i can reproduce the bug for more info if you need.

It’s been happening to me for a while , I am using the latest 5.0.1 (was happening on 5.0.0 too , but didn’t happen on 4.27 versions) : (

Disabled Live Coding , all works fine now.

2 Likes

This is most definitely happening to me.
I can not help but think that this is an order of operations WRT the opening of the project.
Can someone else outline the steps they are using to open the project up?
I’m opening the .sln first and then opening the uproject.
I’m not launching the editor through the debugger…

1 Like

I was having this issue as well. Project was working fine, then I closed it for the day and when I came back my blueprints that inherited C++ classes wouldn’t open with the same warning. After opening the project and few times and recompiling however, the error went away by itself – no changes necessary.

1 Like

Update to this: I kept having the issue every time I restarted the project. In addition, whenever I restarted the project all the values I had given in the editor for variables I exposed with the ‘Edit Anywhere’ attribute were reset. I fixed it all by disabling live coding in editor preferences.

If Live Coding was causing so many development-breaking bugs, it makes me wonder why it was enabled by default.

2 Likes

I am in unreal 5.0.3 and having exact same issue. Everytime I restart my project my Blueprints inheriting from C++ classes become unassociated with the parents and when I search classes to add them back as the parent they dont show up.

2 Likes

I’m having the same issue. It’s clearly not resolved. I was able to get it to work by turning off Live Coding, closing Unreal, and then building in VS Code (I normally use Rider).

2 Likes