# Where to store global variables?

**URL:** <https://forums.unrealengine.com/t/where-to-store-global-variables/280331>\
**Category:** Mobile\
**Tags:** unreal-engine, editor, UE4, CPP, question\
**Created:** [April 11, 2014, 5:42pm UTC](https://forums.unrealengine.com/t/where-to-store-global-variables/280331 "2014-04-11T17:42:34Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Mattk50](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mattk50](https://forums.unrealengine.com/u/Mattk50)\
**Post date:** [March 17, 2019, 5:14pm UTC](https://forums.unrealengine.com/t/where-to-store-global-variables/280331/10 "2019-03-17T17:14:41Z")

</div>

The definitive solution at this point is the GameInstance rather than gamesingleton or similar, it is a valid solution for all game setups even transitioning between multiplayer levels and maps. It starts with the engine and closes with the engine, so if you say, have a setting you want loaded at startup and then to stay in a persistent, accessible place regardless of what servers or levels the player goes to, or pawns or controllers are created or destroyed, that’s the way to do it.

> **[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...

Don’t abuse the game instance by placing level or current game related variables there, but it’s the perfect place for things like settings that arent specific to levels or pawn, controller etc objects.

---

_[View the full topic](https://forums.unrealengine.com/t/where-to-store-global-variables/280331)._
