How to set visibility of a BP's component in a multiplayer?

Greetings!

Here’s the problem :
I have a BP Actor class. I have a box collision and a particle system (visibility unchecked) components in there. When player overlaps the box it lets him press a button which makes the particle visible. However, when I try a multiplayer, it only shows particle to the player who pressed the button and not to anybody else.

Here’s my BP set up :

I have also replication checked for this BP, still doesn’t work for everybody.

Components don’t always replicate, you might have to set the replication up on the individual component. So at BeginPlay you could do the following-

110014-particlereplication.png

I think that will solve your issue.

You can find further information here - Component Replication | Unreal Engine Documentation

Thanks

Thanks! That works. That toggles visibility when you play as a server and both server and client can see that, however, when you try to toggle visibility as client it only works for a client, not for a server.
Any ideas how to make it work for both when client toggles visibility?

You should make it run on server by using a custom event. So create a custom event and then in the top right click Run On Server, you don’t need to make it reliable as its not gameplay essential.

110025-particlereplication2.png

There is more detailed info on Remote Procedure Calls here -

Well, now client can’t even press a button to toggle visibility, however, Client still can. I’ve tried to change Custom Event to Multicast or Run On Owning Client, yet only Client sees particle system visible when Client press the button.
One more thing I’ve mentioned : in your custom event node you have First Person Character as a target, however, I have the Blueprint I work in as a target. How did you do that?

So the way it should be set up, the button you press should execute a custom event. The ‘Target’ part is just set up automatically and I did that in the First Person Character, so its fine having its target to the name of your own blueprint!

You should be able to press a button still, as that will take the input from a client and then the RPC will execute it on the server.

As the component replicates, just telling it to execute that function on the server will mean the changes made will be reflected on clients.