Using load/save to transition

Most games, especially those with a story-based single player mode or the like, though, will want the player's status after leaving, as well as the state of the level itself, to be persistent across this transition. If we make a simple portal back to FirstPersonExampleMap just like we did in the preceding section, you'll notice when switching back and forth that our player, the items, NPCs, and so on in those levels are as if we had opened them anew, rather than the state they were in when we left, and the player's inventory is loaded anew as well. So now really we need two distinct things:

  • Keeping the player's data intact across any level load
  • Loading and saving the state of that level and its dynamic objects ...

Get Mastering Game Development with Unreal Engine 4 - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.