# Changing replicated variable value from client \[BLUEPRINT\]

**URL:** <https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, client, Replication, unreal-engine, Blueprint, question\
**Created:** [November 8, 2014, 3:13am UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462 "2014-11-08T03:13:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EKafer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EKafer](https://forums.unrealengine.com/u/EKafer)\
**Post date:** [November 8, 2014, 3:13am UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/1 "2014-11-08T03:13:17Z")

</div>

Im trying to change the variable (RepNumber) value from client. The variable is replicated, but in execution both client and server have different values in variable.

[http://postimg.org/image/csv6pl4t5/](http://postimg.org/image/csv6pl4t5/)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [November 10, 2014, 5:34pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/2 "2014-11-10T17:34:03Z")

</div>

Hey -

Just to restate so I understand your question, you want the client to be able to change the value of the variable independent of the server, correct? If this is teh case you can use the “Is Server” node with a branch node. This will determine whether the call is coming from the server or the client. Here is a brief example that changes the value of a boolean from True to False depending on if the server (T) or client(F) makes the call:

 ![20662-clientvarchange.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/5/425d0e4503154354ea54478dd4145b0fe12201db.png)

Cheers

---

<div class="post-metadata">

**Author:** ![EKafer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EKafer](https://forums.unrealengine.com/u/EKafer)\
**Post date:** [November 10, 2014, 5:51pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/3 "2014-11-10T17:51:16Z")

</div>

I just want to have a variable replicated in client and server, but set the value in the client.  
Just marking the variable as 'Replicated" doesn’t seems to work, neither using a function as “Run in the server”.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [November 10, 2014, 9:18pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/4 "2014-11-10T21:18:03Z")

</div>

What type of blueprint is the variable being set up inside? Knowing how the variable is set up and what it is used for will help determine the best way to set it up inside the blueprint.

---

<div class="post-metadata">

**Author:** ![EKafer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EKafer](https://forums.unrealengine.com/u/EKafer)\
**Post date:** [November 10, 2014, 9:33pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/5 "2014-11-10T21:33:46Z")

</div>

I was just testing, so it’s all in the CHARACTER blueprint. Variable is integer, and marked as replicated.

---

<div class="post-metadata">

**Author:** ![EKafer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EKafer](https://forums.unrealengine.com/u/EKafer)\
**Post date:** [November 10, 2014, 9:58pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/6 "2014-11-10T21:58:25Z")

</div>

edited: it’s in the character blueprint.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [November 11, 2014, 4:52pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/7 "2014-11-11T16:52:12Z")

</div>

Hey -

The character is going to be replicated across the server and client, so each one will have their own, independent instance of the variable. If you are trying to set the variable on the client and have that same value show on the server you may want to try setting it in the player controller instead.

Cheers

---

<div class="post-metadata">

**Author:** ![EKafer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EKafer](https://forums.unrealengine.com/u/EKafer)\
**Post date:** [November 11, 2014, 4:55pm UTC](https://forums.unrealengine.com/t/changing-replicated-variable-value-from-client-blueprint/298462/8 "2014-11-11T16:55:06Z")

</div>

Oh, I see. Yeah, I want a global value. I’ve tried in character BP, level and gamestate, with no success.
