# My Game Instance is saying my Widget Reference isn't valid after switching level.

**URL:** <https://forums.unrealengine.com/t/my-game-instance-is-saying-my-widget-reference-isnt-valid-after-switching-level/1672366>\
**Category:** Blueprint\
**Tags:** Variable, game-instance, unreal-engine, Widget, Blueprint, question\
**Created:** [February 7, 2024, 4:07pm UTC](https://forums.unrealengine.com/t/my-game-instance-is-saying-my-widget-reference-isnt-valid-after-switching-level/1672366 "2024-02-07T16:07:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JordvL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JordvL](https://forums.unrealengine.com/u/JordvL)\
**Post date:** [February 7, 2024, 4:07pm UTC](https://forums.unrealengine.com/t/my-game-instance-is-saying-my-widget-reference-isnt-valid-after-switching-level/1672366/1 "2024-02-07T16:07:50Z")

</div>

When the game begins, I create all of my widgets and promote them as a variable within my player blueprint.

 ![CreateWidget](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/1/6d181634426cc2c70e9f3781398e9e6d92e12583.png)

Then when you accept a quest, a widget button gets added to the Widget _QuestLog_ and it’s data stored inside the button as well as stored inside the Game Instance in Arrays. All of this code in the image below is done inside a separate widget blueprint called _Dialogue_.

 ![WidgetCallingQuests](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/a/b7aa9987a4b43736fa90e140c91063a73b6f712b.png)

This is what GI\_AddToQuestLog looks like when it adds the button, there is more code further on but isn’t relevant for this.

 ![WidgetRefIsValid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/4/6f48ab24e6aa9ccf51e6aafc65b3e32598fd8e43.png)

You can see I add a Is Valid Node. When you’re in the Level you spawn in, lets call it 1, the button adds to the quest log as normal because the widget is valid. When I switch level to 2, The level 2 blueprint runs this function which uses the stored data in the Game Instance to re-populate the _QuestLog_ widget so the quests stay consistent when switching levels.

 ![GIAddingQuest](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/1/451014febe4a88f74a78079b0faa8d6521151242.png)

When this runs however, it says the reference to the _QuestLog_ widget is not valid and doesn’t work further.

I’m pretty unexperienced with Game Instances and I need this to work for my uni project - it’s an open world game where the quests need to carry over from entering and exiting buildings (levels).

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 7, 2024, 6:34pm UTC](https://forums.unrealengine.com/t/my-game-instance-is-saying-my-widget-reference-isnt-valid-after-switching-level/1672366/2 "2024-02-07T18:34:28Z")

</div>

I didn’t read this in great detail, but I can tell you that anything that isn’t held in the game instance will get trashed if you’re using ‘open level’.

How are you switching?
