# Game instance not working

**URL:** <https://forums.unrealengine.com/t/game-instance-not-working/829293>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [March 28, 2023, 4:07am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293 "2023-03-28T04:07:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheSceriffo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSceriffo](https://forums.unrealengine.com/u/TheSceriffo)\
**Post date:** [March 28, 2023, 4:07am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293/1 "2023-03-28T04:07:26Z")

</div>

Hi, in my game I have a first level where you create a character and then a second one which is the actual game map. In the first level, you change your look by clicking a button that increments/decreases a game instance variable that is called in the character blueprint and with a switch on integer, assigns a mesh. Basically, I have a variable in game instance that gets decreased/increased in the first level ui, in the character blueprint I cast to the game instance get the variable-\> switch on integer and assign a mesh based on that. The mesh gets assigned correctly in the first level but once I go to the second level, the outfit gets reset. I tried printing the variable in the second level and it doesn’t reset. The variable remains the same but the mesh assigned resets. Any help?

---

<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:** [March 28, 2023, 7:06am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293/2 "2023-03-28T07:06:38Z")

</div>

Every time your character is spawned ( or starts a new level ), they have to re-read their settings from the GI, and set their mesh.

---

<div class="post-metadata">

**Author:** ![TheSceriffo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSceriffo](https://forums.unrealengine.com/u/TheSceriffo)\
**Post date:** [March 30, 2023, 12:12am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293/3 "2023-03-30T00:12:55Z")

</div>

So how should I do that? Assign the mesh in the instance rather than character blueprint?

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [March 30, 2023, 1:27am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293/4 "2023-03-30T01:27:25Z")

</div>

So… …when you travel from the first level to the second level, you may have to call the event which sets the character mesh based on the variable in the game instance.

I believe you are claiming that the variable is preserved in the game instance from the first level to the second.

Could double check; however, I believe the character’s “event begin play” should be triggered when you enter the second level of which you could re-read the game instance variable at this time and set, or re-set, your assigned character mesh.

---

<div class="post-metadata">

**Author:** ![TheSceriffo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSceriffo](https://forums.unrealengine.com/u/TheSceriffo)\
**Post date:** [March 31, 2023, 1:26am UTC](https://forums.unrealengine.com/t/game-instance-not-working/829293/5 "2023-03-31T01:26:08Z")

</div>

yes recalling the function on begin play did the trick thanks!
