# How to properly set variable in gamestate?

**URL:** <https://forums.unrealengine.com/t/how-to-properly-set-variable-in-gamestate/481720>\
**Category:** Multiplayer & Networking\
**Tags:** multiplayer-shooter, unreal-engine, question\
**Created:** [April 10, 2021, 8:14pm UTC](https://forums.unrealengine.com/t/how-to-properly-set-variable-in-gamestate/481720 "2021-04-10T20:14:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_One](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marc\_One](https://forums.unrealengine.com/u/Marc_One)\
**Post date:** [April 10, 2021, 8:14pm UTC](https://forums.unrealengine.com/t/how-to-properly-set-variable-in-gamestate/481720/1 "2021-04-10T20:14:17Z")

</div>

ive come across the following problem:  
i have a array of a struct holding also the players names in gamestate. to change the name a client can call a event, that is run on the server. this changes the array element for the name.  
but i can only run it from the listen server. the client does nothing ☹

---

<div class="post-metadata">

**Author:** ![Marc\_One](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marc\_One](https://forums.unrealengine.com/u/Marc_One)\
**Post date:** [April 11, 2021, 9:30am UTC](https://forums.unrealengine.com/t/how-to-properly-set-variable-in-gamestate/481720/2 "2021-04-11T09:30:01Z")

</div>

the reason for that was that i tried to call that from an ui widget. those are owned by the client. i now call an event in the playerontroller which then changes the name. and it works.

---

<div class="post-metadata">

**Author:** ![Marc\_One](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marc\_One](https://forums.unrealengine.com/u/Marc_One)\
**Post date:** [April 11, 2021, 11:24am UTC](https://forums.unrealengine.com/t/how-to-properly-set-variable-in-gamestate/481720/3 "2021-04-11T11:24:57Z")

</div>

that was indeed my problem but i could solve it by calling the server event from the playercontroller. not from the widget. (it still comes from the widget, but goes to playercontroller first)
