# Why is my GameState reinitialized with each level load?

**URL:** <https://forums.unrealengine.com/t/why-is-my-gamestate-reinitialized-with-each-level-load/293451>\
**Category:** World Creation\
**Tags:** gamestate, unreal-engine, level, question\
**Created:** [September 11, 2014, 5:43pm UTC](https://forums.unrealengine.com/t/why-is-my-gamestate-reinitialized-with-each-level-load/293451 "2014-09-11T17:43:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ab98422](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ab98422](https://forums.unrealengine.com/u/anonymous_user_8ab98422)\
**Post date:** [September 11, 2014, 8:17pm UTC](https://forums.unrealengine.com/t/why-is-my-gamestate-reinitialized-with-each-level-load/293451/2 "2014-09-11T20:17:13Z")

</div>

A class is not an object. The object would contain the data, but the object is not the same, it is a new one.

think of a class liek a cookie template and the objects are the cookies. Two can be colored and flavored differently but they both would look like the same cookie. xD

If you are comming from Unity, there is no DontDestroyOnLoad like behaviour in UE4 that I know of. But you could use stream levels and do it this way.

To transport data from one level to another you could either save it to an .ini file if it are just a few variables and cheating is no problem or you could create a binary that is loaded an populates the GameState data again in the next level.

Here is a huge document on this topic and it really depends on what you wanna do serialization.

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

Here is also a nice discussion about this topic

> **[PlayerState persistence across map change](https://forums.unrealengine.com/questions/43814/playerstate-persistence-across-map-change.html)**
>
> So I had some questions about the persistence across map change of PlayerState and talked to JMarkiewicz about it on IRC. I’m posting this for posterity in case someone else is looking for the same answers. Hopefully this quote can help the guys...

---

_[View the full topic](https://forums.unrealengine.com/t/why-is-my-gamestate-reinitialized-with-each-level-load/293451)._
