Last major change in project was creating a blue print child of mygamemode (c++) setting it as project default game mode. And doing the same for my gamestate.
So far I’ve recreated it by accident in another project using c++ to assign teams in a bool in a c++ playerstate but using a child blueprint of these instead of the c++ as the primary project files.
To create these conditions in a project the following will be a condition to create it.
You call a blueprint child of your game mode which has a header such as this in the c++ gamemode.
//// GibballGameMode.h
public:
// If I comment this out and the implementation of it in the cpp it will load the project.
AGibballGameMode(const FObjectInitializer& ObjectInitializer);
//// GibballGameMode.cpp (this had to be commented out in order to load as well…)
AGibballGameMode::AGibballGameMode(const FObjectInitializer & ObjectInitializer)
: Super(ObjectInitializer)
{
// set default pawn class to our Blueprinted character
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Player/BP_Player"));
DefaultPawnClass = PlayerPawnClassFinder.Class;
// use our customer HUD Class.s
HUDClass = AMyHUD::StaticClass();
PlayerControllerClass = AMyPlayerController::StaticClass();
PlayerStateClass = AMyPlayerState::StaticClass();
GameStateClass = AMyGameState::StaticClass();
bDelayedStart = true;
}
My findings conclude that there is a conflict with the Blueprint Child of Game mode calling the StaticClass which causes the editor whom when a blue print is the game mode no longer protects the overrides. perhaps causing an infinite loop, one is waiting for the other?
So far I believe i can accomplish what i want now.
Ok, just for the records: we are using 4.12.5 and experience a very similar problem. We have a C++ class derived from “AGameMode”, and a BP game mode class, which derives from our custom C++ class. In the C++ constructor we had something like this:
With that code the editor also freezes at 72% while starting up. However, as soon as I comment out these lines above, everything works fine again. That way we had to set the default pawn via the BP game mode class, which is fine I guess.
In any case: Thanks for posting this, you have save me a lot of time
Actually, the problem does not seem to be setting the DefaultPawnClass, but the call to ConstructorHelpers::FObjectFinder. Have you managed to get the reference to the UClass of a BP class from within the constructor of a C++ game mode class?
Man I’ve spend around 4 hours trying to figure out what the "§ll is going on and this post saved me, thanks so much.
From my side I fixed it by commenting out the initializers for the default pawn class and default hud from the base GameMode. (UE V4.14.3)
AMasterOfShadowsGameMode::AMasterOfShadowsGameMode()
: Super()
{
// Commented out all of this and it just worked again :)
// set default pawn class to our Blueprinted character
//static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Dynamic/Character/Behavior/Character_BP"));
//DefaultPawnClass = PlayerPawnClassFinder.Class;
// use our custom HUD class
//HUDClass = AMasterOfShadowsHUD::StaticClass();
}
Tried different constructor helpers (FClassFinder, FObjectFinder) to find Bluepring inherited from c++ class and found out that editor starts only with this line in constructor commented. Kinda stuck, because I need to spawn BP inherided from c++ class
The reason being for myself was a derived GameMode → GameMode BP and the FClassFinder was looking at a blueprint that referenced the GameMode BP. This will always be a problem I just hope they add a warning instead of allow it then crash.
i have also experienced this , and this was because i had a c++ gamemode class and made a blueprint child of it, in the blueprint i changed the HUD actor but in the c++ gamemode constructor it also try to set de HUD. Just deleted it from the constructor defining in BP is for me finer
I had this happen on engine 4.20.1. My project wouldn’t load and just quit at 73%. When I tried to open the engine (not my project - as if I were starting a new project) it stopped at at 72%. Engine version 4.19.2 still launched correctly. This told me the 4.20.1 engine was the problem, not my project.
My solution:
Open the Epic launcher
Click the down arrow next to the problem engine (in my case 4.20.1) and select ‘Remove’.
Click the ‘+’ next to ‘Engine versions’, and reinstall 4.20.1.
Make a cup of tea
Hey presto, once it’s installed, everything is working again.
I’ve no idea why it broke, but removing and reinstalling the engine fixed it. Hope this helps someone else!
thank you it helped me but the problem with me happened when i want to override OnHit Event in blueprint class child of c++ one ,when i deleted the class from content folder project load normal and when i returned it the load stuck again ,but when i commented the lines in game mode constructor like you did it load normally again.
I’m about to try this on 4.18.3. Same exact issue, same exact code added.
If I comment the code out, open up the project, add the code back in, and then hot reload from the editor, everything is fine. I even made a build, no problems whatsoever.
Close with that and try to reopen, stuck at 72%.
I will also try removing the old child blueprint GameMode that I no longer want to use like the older comments here mentioned