# \[Crash 4.6.1\] UMG get gamestate on construct level load

**URL:** <https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211>\
**Category:** UI\
**Tags:** load-level, unreal-engine, crash, bug-report, Blueprint, question, UMG\
**Created:** [February 6, 2015, 7:37pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211 "2015-02-06T19:37:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OpticalShadows](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OpticalShadows](https://forums.unrealengine.com/u/OpticalShadows)\
**Post date:** [February 6, 2015, 7:37pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211/1 "2015-02-06T19:37:03Z")

</div>

The editor will crash if you set the promote GetGameState to a variable on contruct in a UMG widget. The widget is added to the viewport via GameInstance so normal UMG level transition crashes shouldnt occur. Tested on a blank project.

1: Make 2 Levels

2: Create a UMG widget whose construct event gets GameState and promotes it to a variable.

3: Set up game instance to have a show hud event that creates the widget.

4: Level blueprint tells game instance to show hud.

5: Load another level using Open “mapName”.

6: Crash.

7: Remove the GetGameState and setting to variable.

8: Doesnt Crash.

Crash report states that the map hasn’t been cleaned by garbage collection.  
Removing the widget from parent before loading a level doesn’t affect it either.

Here is the construct of the UMG widget

![29212-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/8/e2811b1dc8ebddf946df1e131873ccdb93fdc60f.jpeg)

Here is the GameInstanceClass

![29213-capture2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/0/f3010002e9518bbc49e0435ce9a93a758c106eaa.jpeg)

Here is the level blueprint

 ![29214-capture3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/e/24ef0fe2622ab95a54fe6af32bd2d3bf3ee2c2cb.jpeg)

[CrashLog][4]

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 9, 2015, 5:03pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211/2 "2015-02-09T17:03:27Z")

</div>

Hello ,

I was able to reproduce this using the reproduction steps provided above. However, I did a bit more testing. I found that this has been fixed on a later version of the engine. Thank you for your time and information as pertains to this issue.

Make it a great day

---

<div class="post-metadata">

**Author:** ![OpticalShadows](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OpticalShadows](https://forums.unrealengine.com/u/OpticalShadows)\
**Post date:** [February 9, 2015, 5:25pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211/3 "2015-02-09T17:25:16Z")

</div>

Thanks for the reply. I know that this is fixed with 4.7 as I’ve tested, but it seems thats only the case if you enable bUseSeamlessTravel. Is that the case for you or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 9, 2015, 6:20pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211/4 "2015-02-09T18:20:54Z")

</div>

Hello ,

I set it up in the exact same manner both times. I did not make any changes (other than the version of course) and I set it up exactly as you have shown in the pictures provided.

---

<div class="post-metadata">

**Author:** ![djevo2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@djevo2](https://forums.unrealengine.com/u/djevo2)\
**Post date:** [January 6, 2021, 9:27pm UTC](https://forums.unrealengine.com/t/crash-4-6-1-umg-get-gamestate-on-construct-level-load/306211/5 "2021-01-06T21:27:00Z")

</div>

I am noticing this exact issue when reading from a load game data from disk. If i remove it, it doesn’t crash when I have it and load a level it crashes. It is caused by an error UObject cannot be created during garbage collection.
