# Changing a variable of 1 client only

**URL:** <https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [November 19, 2024, 11:36am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097 "2024-11-19T11:36:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![IRANpower](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IRANpower](https://forums.unrealengine.com/u/IRANpower)\
**Post date:** [November 19, 2024, 11:36am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/1 "2024-11-19T11:36:36Z")

</div>

Hello everyone, i want to make a turn based game, where players take turn to do a specific action, im abit familiar with the networking but i cant just figure this out. The way i tried to approach was to have a boolean variable inside the character BP, and then have an " on post login " inside game mode and get an array of the players logging in, but i still couldnt figure out how to access thought players and change their variable ? am i even on the right path ?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [November 19, 2024, 11:29pm UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/2 "2024-11-19T23:29:09Z")

</div>

On Post Login passes you a reference to the player controller. Take that reference and cast to your specific controller class. Store that reference in a custom struct.

In the controller class create an event (Run on Owning Client). In the GM you can then use the controller reference in the struct to call the specific event.

---

<div class="post-metadata">

**Author:** ![IRANpower](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IRANpower](https://forums.unrealengine.com/u/IRANpower)\
**Post date:** [November 20, 2024, 8:26am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/3 "2024-11-20T08:26:42Z")

</div>

something like this ?, then how can i use the canshoot? variable inside my thirdpersonBP ?

 ![1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/3/633accc21b85d68e459c09cb22773595c0df9f52.png)  
 ![2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/8/d5890315ddc98f64e9b80b477e018715be990b45.png)

---

<div class="post-metadata">

**Author:** ![IRANpower](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IRANpower](https://forums.unrealengine.com/u/IRANpower)\
**Post date:** [November 20, 2024, 9:44am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/4 "2024-11-20T09:44:22Z")

</div>

PS: all of my code are in thirdpersonBP, will that matter ?, how can i make the controller communicate with the thirdpersonBP ?

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [November 20, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/5 "2024-11-20T14:48:46Z")

</div>

They say a picture is worth a thousand words… video must be a million words then…

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/5/5c5bf647b2dc34edbb83cdae364272a1333765f0.jpeg "Unreal Engine - Turn Based Game Fundamentals (2/3)") ](https://www.youtube.com/watch?v=5Yz5_p8g1Iw)

---

<div class="post-metadata">

**Author:** ![IRANpower](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IRANpower](https://forums.unrealengine.com/u/IRANpower)\
**Post date:** [November 21, 2024, 8:30am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/6 "2024-11-21T08:30:00Z")

</div>

Thankyou, it was very detailed video, i watched it already twice, and got my problem solved, for sure ill be watching it more, Thankyou

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 21, 2024, 8:30am UTC](https://forums.unrealengine.com/t/changing-a-variable-of-1-client-only/2135097/7 "2024-12-21T08:30:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
