[BUG] Gamemode not working initially

Blueprint GameMode based off GameMode C++ class not calling BeginPlay or using playercontrollers or hud until Open Full Blueprint editor was opened and activated the Event BeginPlay node.

Hello ,

Can you please give more details on what you have in your Event BeginPlay and your overall setup? I tried reproducing this by doing the following:

  1. Created a fresh C++ project
  2. Added a C++ GameModeBase class (which is what should be used now rather than GameMode itself in 4.14)
  3. Added a BeginPlay override and had the BeginPlay function print a log message
  4. Created a blueprint based off of my custom C++ GameModeBase class
  5. Without opening the blueprint, made it the default game mode in Project Settings > Maps & Modes
  6. Hit Play

And at this point, the log message was printed successfully. Please let me know if there is something different that is being done here that could be causing the issue.

Ok ill go over what Ive found

  1. New Project Third Person C++
  2. create Player blueprint from Character C++
  3. create Player Controller blueprint from PlayerController C++
  4. create HUD blueprint from HUD C++
  5. create Custom Gamemode blueprint from GameMode C++
  6. in CustomGameMode blueprint change defaults to use above listed blueprints

launch game
observance - Correct Character, Player controller and HUD “NOT” working using printstrings on each connected to the BeginPlay Nodes inside each blueprint class. Set BreakPoints as well no breaks reported.

Open GameMode blueprint and click OPEN FULL BLUEPRINT EDITOR
again Launch game still same results (BeginPlay node is greyed out)
Open GameMode blueprint add connection to BeginPlay node to print string

Launch Game everything works and is responding as expected.

is this C++ class (GameMode) depreciated ? should I use the GameModeBase ONLY now?

Thank you for that explanation. After reproducing this, it seems that the changes made to the GameMode class’ classes cause it to be compiled automatically upon hitting Play. Be sure that your GameMode is being saved/compiled after you make changes to things such as HUD Class or Default Pawn Class.

Can you try this reproduction again but with compiling the GameMode BP after making these changes?

We haven’t heard from you in a while, . Are you still experiencing these issues? If so, can you try what I mentioned in my previous post? In the meantime, I’ll be marking this issue as resolved for tracking purposes.

The real problem is game mode override in the world settings.

In the Cpp template this value is set to the cpp class.

1 Like