Cannot cast GetGameMode() to child game mode blueprint

Something similar was mentioned here: Unreal Engine Issues and Bug Tracker (UE-37922)

Why was it closed with “Won’t Fix”?

(edit: answer hub submission link: [Infinite Loop] Workaround for bug causing stuck at loading 70%, 71%, or 72% - Blueprint - Unreal Engine Forums )

I have attached a project. It won’t load past 72%.

Steps to reproduce (copy this into your ticket, I already tested it from a FP template.)

  1. Create FP C++ template
  2. Create BP child of your CPP GameMode
  3. Change Project to use BP Game mode
  4. In BeginPlay() of Character BP call GetGameMode pure function and cast it to your Blueprint game mode (child of C++ gamemode)
  5. Reboot editor
  6. It won’t load past 72%

Project sample:
https://drive.google.com/file/d/0B8XZp93HI41kMC1MNFpJLU1XMlk/view?usp=sharing

Hello,

Thank you for posting the link to that issue muchcharles, I do agree that that is likely the same issue. I’ve updated the ticket with the reasoning for it being closed as Won’t Fix, so if you take another look at the public issues link you should be able to see that now.

Just to post the reasoning here for convenience: “There’s no way around it in UE4. The native AMyGameMode class load the character blueprint which has the same native AMyGameMode class as its export so AMyGameMode’s CDO needs to be constructed on load which leads to a dead-lock caused by internal C++ guard on static local variables.”

Have a great day