I am trying to make a system where when I click a button in a widget, all lights turn off. The blueprint works and everything is fine, but when it comes to multiplayer gameplay, only the client who activated it can see it, every other client will have nothing happen. Same thing with other lighting.
All of this is in the ThirdpersonBP
I have tried multicast already, it seems that anything i change the visibility of does not replicate
Hi, you’re using “RunOnOwning Client” for the “Electrical Button” event, meaning only one client will execute this logic. The other clients won’t.
If you want all clients to execute this logic, then use a “Multicast” from the server instead.
The only client that can call “RunOnServer” Events on an actor, is the client that owns this actor (and there can only be one owner). Therefore if you want the client to be able to call “RunOnServer” Events in the Level Blueprint, then you need to set this client as owner of the level blueprint actor on the server. Therefore you would rather put “RunOnServer” events either into the player controller or the controlled pawn since both are owned by the client that controls them by default.
Right, “SetVisibility” does not replicate. That’s why you need to execute that node locally on every client where you want to change it. If you call a “Multicast” event from the server, then all relevant clients (and the server) will execute that event locally.
And of course the server needs to call that “Multicast” event. If a client does so, then only that client will execute the event.
what about the hiddeningame node. Also, changing material nodes dont seem to replicate either.
Do you mind giving an example?
hiddeningame node. Also, changing
material nodes
Yep, those won’t replicate automatically. As for an example: Client hits button in widget → widget calls “RunOnServer” event in either player controller or controlled pawn (widgets only exist locally so they don’t replicate) → now that the you’re on the server you call a “Multicast” and from that call all the events you want to execute on all clients
Generally speaking, if you call some function, then it will only execute locally and everyone else will not know about this (unless the function you execute calls an RPC on its own somewhere under the hood).