Server not setting variable

The server isn’t setting the Lazer VFX variable,in the print string it don’t return anything,but the client sets the variable correctly.im playing with ‘play as client”

if you use play as client you need to make sure in the settings that it spawns the server automatically.

does the print string works? whan does it prints?

also make sure the object that calls that function has an owner chain that goes to the local player controller.


it prints.but in the server the variable dont work

if i play as “play as listen server” then it work fine

but in “play as client” the server simply dont get the variable

Do you have ownership of the actor that is calling the server function?

Have you tried calling the server function from the player controller of the client or it’s pawn (you need to have ownership or the execution will be ignored)

the server execution works fine.if i put a print string in the execution it prints fine.the problem is when setting a variable
i’ve tested and i found that boolean or float variable works,but the niagara reference don’t

Seems the replication of the component doesn’t seem to work for some reason. You could just call a multicast function on the server passing in the location and duplicating the code from your image.
Multicast seems to work in this regard, though it’s not ideal.

Alternatively found a solution that somewhat works. I don’t replicate the component but I have a variable of type niagara system that is replicated as on rep notify, that triggers the change in the component indirectly.

It triggers ok in the dedicated server sim.

I disabled run under one process in the adv server settings just in case.

i’m not using an component,im spawning like this:

Yeah if i make an “add component node” instead of the “spawn system at location” it works.But i found out that it makes a lot of lag and my fps drops(something that “spawn system at location” don’t generate).Maybe i can try modify the niagara system so that it dont lags but is there a better way to do this?for now i will stick with the “add component node”

Call a multicast on the server that will do the spawning on the clients then. It’s the most optimal way if you are spawning the system at location.

Perticles should be pretty much decorative. Try replicating what drives the effect and pass that on to the client’s version.

i’ve found a way to remove the lag on the niagara,just turn off ray tracing on the niagara component.I’ve also created an other actor just for that.But i think your solution will also work.but the diference to mine is minimal.so i’ll stick with mine.thank you for your answer!