# Keep Inventory when loading level

**URL:** <https://forums.unrealengine.com/t/keep-inventory-when-loading-level/343382>\
**Category:** Editor Scripting\
**Tags:** inventory, unreal-engine, FeatureRequest, UE4, Blueprint, question\
**Created:** [January 7, 2016, 2:41pm UTC](https://forums.unrealengine.com/t/keep-inventory-when-loading-level/343382 "2016-01-07T14:41:25Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![walldiv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walldiv](https://forums.unrealengine.com/u/walldiv)\
**Post date:** [January 29, 2016, 5:37pm UTC](https://forums.unrealengine.com/t/keep-inventory-when-loading-level/343382/6 "2016-01-29T17:37:26Z")

</div>

The above answers/comments are partially correct - however in order to have a transition state SAVED through game state transitions - you need to utilize the GameInstance classes for game related variables and PlayerState class for players… here’s why:

When a state transition happens within the game (Either through custom states in your GameMode or by level transitions, or by logging in/out) your EVENT BEGIN PLAY runs on all your blueprints… LAMENS TERMS: Your actor is re-instantiated. All your variables that you have stored at runtime now become re-defaulted at this point. . . EXCEPT for in the above classes - which hold their variable values persistent through such changes!

in a Networking/Multiplayer game - GameInstance and PlayerState are created for each player in the world - they hold their own instances of these classes. Make sure to setup the GameInstance in the Maps&Modes section of your Project Settings.

REFERENCES:

> **[UGameInstance](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Engine/UGameInstance/)**
>
> GameInstance: high-level manager object for an instance of the running game.

> **[How to use the GameInstance BP to send info to other levels?](https://forums.unrealengine.com/questions/91531/how-to-use-the-gameinstance-bp-to-send-info-to-oth.html)**
>
> I’m starting to get in to the multilevel part of development, and I’m not sure how this GameInstance BP works. I know you put it in the Maps & Modes Project settings. I found how to load another level in the game, but I want to send my variable...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[Player State VS Player Character](https://forums.unrealengine.com/questions/231219/player-state-vs-player-character.html)**
>
> If i have a bunch of data that varies from character to character (Health, mana, energy, levels, etc). Would it make sense to put all this in Player State or Player Character?

---

_[View the full topic](https://forums.unrealengine.com/t/keep-inventory-when-loading-level/343382)._
