[4.7] Keep pointer variables in-between levels

Hi 5kwatts,

UObject object pass through levels with host in GameInstance class or GameSingleton class all works well in my situation. But i recommand host in GameInstance class, Singleton has much more problem with object references.

Your Inventory classes should be pure data struct or data container and do not reference any Actor references, because actors are hosted in world and will be destroyed on level end, but uobject in gameinstance will not destory. You can rebuild your inventory widget from UObject data in new level begin play event.

This pattern called MVC, model, view, and controller. pure data objects are models, umg widgets are views. gameinstance, gamemode, playercontroller,levelbp are controllers.

Hope this can help you.

Cheers
Omega