Hi everyone, I spent a long time searching for this solution online and this has happened to me twice now. So I took the time to figure out the cause of the issue in my particular case to hopefully help reduce the time needed to fix it in the future. And there were many posts of people experiencing this issue without a reply, or their solution was to delete the blueprint and rework code. Well this isn’t necessarily possible for a lot of projects, so I wanted to post this here to hopefully help others if they’re experiencing the same problem!
TLDR: If you’re experiencing this issue, look for places where in ClassA.cpp you cast to ClassB.cpp in C++ and then in ClassA blueprint you also cast to ClassB blueprint. Remove the cast in the blueprint and replace with an interface that provides the necessary reference.
Problem: When loading up a project in Unreal Engine 5, the project loads up until 75%, and then stops loading. Task manager also shows 0% CPU usage. No matter how long you wait, it will not load.
The issue usually involves a blueprint, and if you remove the problematic blueprint from the content folder, the project will load. Each time this has happened to me it’s been a blueprint that derives from a C++ class.
How to resolve:
Determine which blueprint is causing the problem by removing one at a time and reloading the project each time until it loads.
Once the project loads, put the blueprint back in the content folder. Inspect the other blueprints for casts to the problematic blueprint, and if there is one, check if you also cast to the problematic blueprint’s parent C++ class in the parent C++ file of the blueprint where you found the cast.
In my case, the problematic blueprint was my BP_Player class, which is a child of the PlayerCharacter.cpp class. After doing some debugging, I realized the issue was caused by a cast to the BP_Player class in my BP_Enemy class, which is a child of the Enemy.cpp class. The problem was that I cast to the PlayerCharacter.cpp class in the Enemy.cpp code, and then casting again to BP_Player in the BP_Enemy class caused the project not to load.
The solution, which is better coding practice anyways, is to use an interface instead of casting to a class to get the reference you need.