Replicating a Set from Client to Server not possible??

I was trying to replicate a Set from a client variable into the server, but as soon as I receive it on the server, the **Set **is empty. If I cast it to an **Array **(on the client) right before sending it, it works just fine, and the **Array **contains all elements.

Question: Is this behavior on purpose, and why? Or if I should be able to replicate a set, what’s the way to do it?

It is on purpose mainly to avoid cheating. Unreal uses the Authoritative Server model which means that Clients can only send input (RPC’s) to the server and the server decides what to do with it and sets the variables accordingly.

If you have some client variables you want to send to the server you can do that with a RunOnServer RPC from any Actor the client owns at the time of making the call. This could be its PlayerController or Pawn/Character or any Actor owned by something that the client owns eg. a Flashlight owned by a Character possessed/owned by a PlayerController owned by the Client.

In C++ you have a special validate function that is used to validate the incoming RPC’s and if it is not validated the client gets kicked by the server. Blueprint is more forgiving and doesn’t have this by default but you should still consider making your own validation and kick the player that attempts to cheat if necessary.