Ok So I have racked my brains all night with this problem. I cant get Event BeginPlay to fire no matter what I do. I have GameModeBase and GameStateBase calling Super::BeginPlay() and Super::StartPlay(). I also have added a Parent: BeginPlay node in the blueprint editor with no success. Can anyone help me?
Each Level can override which GameMode it is using so either ensure that it is overriding with your Blueprint version of the GameMode or it is not overridden but set in “Maps & Modes” in the Project Settings.
Make sure that if your GameMode inherits from GameMode that GameState inherits GameState and not GameStateBase. GameMode and GameState has to use the same variant.
I tried it in a new project 4.22 and it all works.
Try print node before Event beginplay in GameStateBase, play and see if you get a message on the screen. (Also remove the override in WorldSettings.) If not then you didn’t set your project settings right. Check that everything is set right. If it still doesn’t work make a screenshot of GameStateBase and the Project settings so we are sure it’s not a problem on your end. (Take the screen-shots exactly like I did in the pictures and also the WorldSettings GameModeOverride)
Ok so I’ve promoted MyGameStateBase to a blueprint but it still doesnt print anything and i’m sure i have everything setup properly could it be something in my c++ code then?
If it is based on your own C++ GameModeBase and or GameStateBase then yes. Check if HandleBeginPlay is getting called in your GameState. If you are overriding HandleBeginPlay you have to call the Super class.
If you aren’t doing anything with the override you could also just delete the function so it isn’t overridden.
How about your constructor? can you show the code for that? please use the code tags so it is easier to read.