I did 3 test:
- Destination map has the
Game Mode
set toNone
:
- Result: When the destination map is loaded the game mode from the map before it is used and
BeginPlay
is triggered and also the values are set to default;
- Destination map has the
Game Mode
set to a different one then the map before it:
- Result: When the destination map is loaded the game mode set on that map is used and not the one from the map before it (same,
BeginPlay
is called, and values are set to default, but here it couldn’t have had new values as it is the first time it is used);
- Destination map has the
Game Mode
set the same as the map before it:
- Result: Same as 1, when the destination map is loaded the game mode from the map before it is used and
BeginPlay
is triggered and also the values are set to default.
I could add in Game Mode
’s event BeginPlay
to instruct it to read the values of the old one, by setting those inside the Game Instance
just before calling the command servertravel
, but if the game mode shouldn’t change on map transition, then I’d rather find the cause of the “reset”. //Edit: Or set them inside the game instance when EndPlay
is called from the game mode.
//Edit:
Or is it that by “persist automatically”, they don’t actually mean that it will keep the values inside of it, but rather the case 1, where if I set on that map GameMode
to none, it will use the same type of GameMode
, rather then it will use the exact same one, with all it’s values?
From my testing the only ones that kept even their values were the Player Controller
. In the lobby I changed the values for a variable (one that keeps track of the class they are using for the pawn) for both the client and the server, with different ones, and when the new map was loaded, then they kept those values.