Loading level and HUD recreation

Hello,

I just trying to load level, as a set of 3D meshes, but when I call this:
GetWorld()->ServerTravel( (TEXT(“/Game/MyScene”) );

My HUD and GameMode classes are all recreated. This gives me another issue: as my whole game initialization/deinit code moved into
void ATachyonWarsGameMode::InitGame(…), ATachyonWarsGameMode::BeginDestroy()
, the methods are called several times. And nothing works.

So, I would love to …

  1. Either find out how do I simply load level as a mesh to world (with possibility to unload it by same name later on), with minimum system wide side effects. I.e. would be nice to have method to replace 3D content without wiping HUD and widgets.

  2. Or, at least I will need a spot, where I can move my game init/deinit methods which will be guaranteed to be called once. Global variable is not good solution here.

What do you mean by “as a set of 3D meshes”?

If you are loading and unloading meshes you can stay in the same level. Otherwise, you can’t load the new meshes until after the new level loads and you’ll need to respawn the player, HUD etc.

You can look at level streaming to load/unload part of level or if you want to switch to another map with a new gamemode etc… and keep certains actors, you should look at Seamless travel implementation where you can set the actors that you want to keep accross travelling.