Level Blueprint and GameMode aren't working after a level change

I have a blank level i’m using as a placeholder menu level. In it i have a button event in level blueprint to call ServerTravel(TestMap?Listen) from my custom GameMode TestGameMode_Menu in c++. new level (TestMap) uses another GameMode called TestGameMode (when i switch levels in editor world setting gamemode are showing correct ones) in which I have a begin play event that prints to screen “new level loaded” in level blueprint.

Everything works fine when I PIE, but when I click launch and run game everything works for blank level but when new level loads level blueprint isn’t calling begin play event.

I also have debug to screen calls in PostLogin and BeginPlay functions in TestGameMode which aren’t getting called and debug calls in TestGameMode_Menu are getting called again, but get called correctly when I PIE but not when i play through launch.

Any help would be appreciated.

Level blueprint will run with level, so if you change level it will run a blueprint of new level, and for gamemode it will persist when it run whatever level you change unless you change gamemode.

I know, but that’s not behavior i’m seeing. When I load new level new level’s level blueprint is not running nor is new level’s new game mode when i play game going through launch button. It only works when i PIE

Hey falola,

Are you still experiencing this issue? Have you upgraded your project to 4.4? If so, is this a code-based project or one built from source? If you use a GameMode created solely in editor and use that instead of custom GameMode you created, does same thing happen?

I upgraded to 4.4 and its a code based. I gave up on trying to get it working in 4.3 but i’ll revisit it now. I haven’t tried to create a game mode in editor yet but I will and get back to you as soon as I can.

It looks like following code (located in my game mode code) isn’t working when i try it from launch it just sits there and doesn’t load level:

GetWorld()->ServerTravel(TEXT("/Game/Maps/ArkhamHorror_Main?Listen"));

Neither will calling OpenLevel with ?Listen in options.

Calling function / blueprint node from my level blueprint
HandleMatchIsWaitingToStart is getting triggered though.
This only happens in launch, everything works fine when i PIE

Ok so after further digging around I found play game standalone which is what i needed and there level loading and game mode works as intended. I also packaged game and everything is working correctly So its only Launch which from what i read is meant to be used for mobile devices so i was using it wrong.

I have found PIE/launch doesn’t consistently handle servertravel very well, and often behaves differently than a built exe or packaged game, so I would test all of your inter-level functionality that way.

Possibly unrelated, since you seem to have resolved your issue, I’ve also found that at least when using seamless travel, you can’t guarantee that level blueprint’s Begin Play will get hit after GameMode or PlayerControllers are initialized, so any functionality you have that’s dependent on those won’t work. See my question here.