# Variables stored in game mode or game instance?

**URL:** <https://forums.unrealengine.com/t/variables-stored-in-game-mode-or-game-instance/145148>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** unreal-engine, Performance, Performance-Profiling\
**Created:** [June 5, 2020, 3:42am UTC](https://forums.unrealengine.com/t/variables-stored-in-game-mode-or-game-instance/145148 "2020-06-05T03:42:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmgold07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmgold07](https://forums.unrealengine.com/u/jmgold07)\
**Post date:** [June 5, 2020, 3:42am UTC](https://forums.unrealengine.com/t/variables-stored-in-game-mode-or-game-instance/145148/1 "2020-06-05T03:42:39Z")

</div>

Hi,

I’ve got a few booleans that keep track of some of the events that occur during a game.  
If you perform task A, the boolean is set to true.  
The game at the moment is only a single map and is single player.  
I had a read of the unreal docs on game mode/game state [https://docs.unrealengine.com/en-US/…ode/index.html](https://docs.unrealengine.com/en-US/Gameplay/Framework/GameMode/index.html).  
Is either game mode or game instance an ok place to store the variables?

Thx

---

<div class="post-metadata">

**Author:** ![DomusLudus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domusludus/32/1215140_2.png) [@DomusLudus](https://forums.unrealengine.com/u/DomusLudus)\
**Post date:** [June 5, 2020, 4:33am UTC](https://forums.unrealengine.com/t/variables-stored-in-game-mode-or-game-instance/145148/2 "2020-06-05T04:33:24Z")

</div>

The game instance is if you want to keep the variable between scene changes. Since the Gamemode is destroyed when loading a new map.  
The game mode is for variables that control the victory conditions of that scene.  
If it is a player action you can save them in the player itself.
