Same here in UE 5.0.3, but, for me, it only happens sometimes, not every time I load the project.
I already tried to disable Live-Coding, but it keeps happening.
My case is a bit different though because the class that loses it’s cpp parent is inside a custom plugin I’m writing (and is a UUserWidget).
I’ve also tried to create a new project and import the plugin, but the result is the same: 2/3 of the times the editor crashes at 75% of the startup.
This is not good. I have this issue with a blueprint that inherits from Actor, no C++ file or similar.
I’ve moved the child blueprints in a different folder, they left behind some small files that were visible only from the windows folder, then I’ve moved the original blueprints back to the folder now they say the class is null
Version: UE-5.0.3
Live Coding: Enabled. (I did attempt to disable this, that didn’t do anything.)
Error 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! Do you want to continue (it can crash the editor)?
Recreate: Make a blueprint derived from CPP class then close the program after compiling and saving lastly reopen and attempt to open the blueprint you will be greeted with this error message.
Hey, I just deleted the “Binaries” folder in the project and opened the Editor. That worked and reopen didn’t take long. No Shader recompile. Just asked me to rebuild the project, which was fast.
Question is, will you have to do that every time you remove/rename/move an Asset? Or is it only related to Cpp- Files or BPs?
Hey there, I had the same issues and it was very annoying. Today I JUST DELETED THE BINARIES FOLDER inside my project folder and all the problems just went away. All C++ classes and all their blueprint child classes now are back and everything work just fine. I have no clue of what might couses this bug, but i hope this solution can help you as well. I use Visual Studio Code and Live Coding. UE 5.02
So, I was having this issue as well, and I did find a solution that worked for me (though I understand it may not work for everyone). I hope others can at least gain insight from how I went about solving my issue.
In my case, I’m making a 3rd party plugin using C++, and was having the issue described by some i.e. whenever I created a blueprint derived from a C++ class, it worked initially, but failed the next time I rebuilt the editor.
Non-solutions proposed previously: deleting the binaries folder (I didn’t even bother with this one, I’m not doing that every time I load the editor), disable live coding (I’m on Linux and currently this isn’t even supported, so there’s nothing to disable), creating a new class and copying over my code (that’s not a solution, it’s just pushing the problem further down the line). Tracking the naming of a C++ class using PipeRift (I never re-named anything so this shouldn’t be the issue).
Solution that worked for me: in my .plugin file I changed
"LoadingPhase" : "Default"
to
"LoadingPhase" : "PreDefault"
Why I believe this solved the problem for me: the blueprint becoming invalid probably means that at the time when the referenced blueprint gets loaded, the corresponding plugin (and hence the C++ class) has not been fully loaded. The blueprint then gets marked as invalid. It also makes sense why even if it’s invalid, remaking the blueprint works as well, because by the time the editor is fully loaded the classes are all fully loaded, and so there’s no issue.
So, overall the issue is most likely with the loading of your C++ class. If you are writing a plugin this can be controlled with the .plugin file. If you are not writing a plugin hopefully this sheds some light.
Thank you! This and if you have 1 game feature plugin referencing a class in another game feature plugin, ensure you have the dependency turned on to that plugin.
For the record, I ran into this today, using UE 5.1. I have a blueprint deriving from my own Character subclass in C++.
Opening the .uproject and trying to edit the blueprint: “invalid class” error message.
Opening the .sln in VS and running the editor from there: no problem.
Not sure if this is related to Live Coding, but I had a ton of issues with reset properties, and even disappeared custom C++ components the day before when making substantial code changes using Live Coding.
The same problem happened to me some minutes ago. Today earlier I created a C++ base class and Blueprint out of it. After some time I decided to rename the C++ class using Rider, which asked me this:
But since I am still learning Unreal, I decided to uncheck the Add Core Redirect. Then after restarting the Unreal Editor, I got the error:
Blueprint could not be loaded because it derives from an invalid class
I found that forum and after trying the suggestion to delete the BINARIES folder with the editor closed, the issue did not appear anymore when opening the project again. Thanks guys.
In my case, I created a c++ class derived from another c++ class, and then I changed the blueprint parent,
The problem then appeared and was fixed by @sandolkakos solution (deleting the binaries folder in the project root)
Hi, just wanted to add that I’m having this issue by trying to Add the Unreal Vehicle Template to my project. I can’t drag the cars into the scene due to this same error.
Totally not C++ realated, I get this error when upgrading from UE4 to UE5, for the ThirdPersonOverview - and it looks like it is about some tutorial class missing. I have no idea why that is not missing from the project I copied…
Just close the Editor, delete the Binaries and Intermediate folder where the Project is and restart. I do this just by default by now as it solves a number of possible occuring issues, including not finding the parent class of a Blueprint.