Cant change variable (client to server)

Hey everyone,

I’ve been struggling with ue4 networking for a while and still haven’t gotten fully behind it.
I want to replicate the variable from the client to the server. It currently works from the server to the client.
What am I doing wrong ?.

Thank you in advance ^^.

If you set a variable locally, the server won’t update its own value. The replication system in UE4 only works from the server to the clients.
If you want your client to send a value to your server, you’ll have to create an event with “Run on server” property, then call it from your client. This event must have an argument, so the value will be sent to your server through this event.
Keep in mind that you can’t send a whole object like an actor or a pawn, you can only send “simple” variables (like integers, floats, etc.), due to replication restriction.
If this solves your problem, I’d suggest you to have a look at this page of the documentation :slight_smile:

Thank you so much.