Simple thing....but how to replicate it?

Hi. I’ve read all documentation about replication but still I cant understand how client → server replication works. Here is simple abstract example.
Lets say we have 3 clients(no dedicated srv) and 1 BP(input is consumed directly by this BP, player controller is not used). Each time T is pressed(no matter who did it) random color must be applied to this material.
I’ve tried everything: repnotify, multicasts etc but color(in all client windows) changes only when i hit T in server window.
Added: as I understand its all about ownership. Actors which were not spawned runtime are are owned by the server. But in this case looks like i need a mulriple ownership or something to be able to call server functions from all of the clients.

I’m noob on UE4 replication so i’m not sure if i’m correct, it kind of my guess using my general knowlage. In replication server got the autority it contains master copy of game state which is sent to clients and clients tries to replicate that state. So client need to send command to server by replicated function call or by change replicated varable it should validate it and do it on server then UE4 automaticly replicates that change to other clients. As one of clients is the server change happens there localy and are replicated to other clients, thats why you see change only when you do it on server.

i know this theory. This is why i asked with 2screenshots and an abstract example of what i need -_-

any thoughts?

Hi

First of all you’ve got to check the replication box of the actor ( maybe you also want to check the ReplicateMovement if it won’t be static actor )

Second, you need to perform the action only on server, so you should create a costume event which RunsOnServer and take all needed parameters, like the reference of the actor

If it doesn’t work, try playing around with these replication boxes

Cheers (:

83849-1.png

83850-2.png

I tried your way before asking here. actually it looks like it doesnt work this way. As i understand only net owner can ask server to fire server function. When object is placed on map in the editor(not spawned during runtime) it is automatically owned by the server. So I solved it by “asking” GameState BP to execute that server function.