Download

[UE 4.5.1] persisting GameMode instance and HUD class instance between levels?

Hi everyone,

I’m trying to use a single HUD class instance and possibly the same GameMode instance between multiple level transitions, but I can’t seem to find the proper way to do that. As far as I can tell with the documentation, both of these should be able to span across multiple levels. My understanding was that if level A and B have their HUD Class set to “HUD_A”, then when I do A->OpenLevel(B) the HUD_A should persist (likewise, the GameMode). but if I put an “Even begin Play” node in the HUD blueprint, this gets called twice!

What am I missing? Is this expected behavior? If so, what is the correct way to get this functionality working (via C++ ? Ini files? etc).
Thanks in advance.

What you set it the class only, only GameInstance will be persist through level, from what i know when u load new level, everything will be created again, if you use seamless travel u can choose what object to pass to new level, then u can use that to apply back to your new created HUD.

Hi Duncan, Thanks for the reply.

From what I understand about seamless travel, this is something we have to essentially setup / program in C++. Do you have any good examples of using only blueprints? Also, we need to setup the ini files properly as I recall. If you have any tutorials / links to info on how to do both seamless travel and then “applying it back” that would be great! C++ And / Or blueprint links and examples are greatly appreciated!