Changing replicated variable value from client [BLUEPRINT]

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/

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:

Cheers

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”.

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.

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

edited: it’s in the character blueprint.

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

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