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

So I created a blueprint character class (BPcharacter) and then later created a C++ class called CPP_shooter, and then I had my blueprint character class inherit from shooter. This worked fine on that day, but the next day when I opened up the editor, it said that my character class could not be loaded because it derives from an invalid class. I open it up, and see that CPP_shooter is no longer the parent, and when I try to search for it, I see that its not a select-able parent. But when I opened up another one of my blueprint classes, I see that CPP_shooter is an option there as a parent. Anyone know how to fix this? I’ve already tried some solutions like running the project from my IDE, deleting the intermediate, binaries, and saved files, but nothing has worked.

Yep, I also encountered the same issue before.

While not being completely sure, I think this happens when certain conditions meet and the editor is launched before the C++ files could be compiled properly. To put it simply, I think it sometimes happens when opening the project from the Epic Launcher or opening the .uproject file from the File Explorer, while the standard approach would be building the project from Visual Studio. But like I said, I couldn’t make a throughout investigation because I wasn’t able to replicate the issue afterwards.

You can fix this by first deleting the .vs, Saved, Intermediate, Binaries folders and the .sln file, and then regenerating the project files by right clicking on the .uproject file, more options, and hitting the regenerate the project files option. I don’t really remember but you might also wanna replace your asset (that’s under the Contents folder) with the older version if you have a backup of your project, don’t really think that would be necessary though.

Hope this can help :blush:


Disclaimer:
Make sure to have a backup of your project before manually adjusting the project files!!!