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?
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.
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.
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…
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:
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.
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…
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.
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.
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.
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).