I just figured out that, OpenLevel() or ServerTravel() will not recreate the game mode actor or even reset it, So I tried to use UEngine::LoadMap() which sets game mode to NULL for some reason.
Is there any way I can manually reinstantiate the game mode?
There currently way to change the game mode during play as stated here
But it does not mean you can’t think out of the box technically you can make single game mode which function platform for other game modes (in diffrent class not related to GameMode), kind of like plug-ins that can be switch between. You know some multiplayer games have “objective” mode, think how to fit that in single game mode and that might bring you to proper solutions. Considering you using C++ it should be a lot easier to for you.
Oh I edited my last comment, but it seems that it didnt save…My bad.
I have figured out what you just said earlier before you post this, and figured out why the crash occurs after restarting the game.
If you can help me in this I’d be very glad :
So My game uses 2 characters, one character per player, I use the defaultly spawned character for player0 and i spawn another character (with a controller) for player1 to use. When I restart the game, I get an additional player spawned (having 3 players), I dont know why this happens
I even tried to destroy all actors before restarting, but didnt work, I still get 3 characters.
Ill dig more into this and see, Anyway Thanks for your help
EDIT:
Okay I figured it out, when I create a player controller using UGameplayStatistics::CreatePlayer(), the player persists when restarting level, so I had to add an additional check whether i already have player1 or should i create one.