Problem with event run on server in bluprint

hi
in my blueprint,i test line trace for weapons in client and server for multiplayer game.why not work?

this is my blueprint
this is function

this is event graph

when i press action like [j] in server, linetrace showed but in client not show

when i press action like [j] in client,linetrace showed in server but in client not show again

You are on the right path, but you need to realize one thing.

ServerOnly functions will only execute on server. So if you tell the server to spawn a particle effect with a ServerOnly function, only that server will see it.

Your functions are working properly, but you cannot expect client to see when the server spawns a particle effect, that’s the kind of thing you need to multicast.

I strongly suggest you have a look at the Blueprint Networking Tutorial as it covers exactly those things, including replicating animations and particle effects!

i use multicast and other option for this but not working.
i think my problem is with variables and other variables for controll camera and world location and rotation line trace

The server should be the only one doing the calculations, like who it traced to, who it’s going to hit, how much damage it will be doing. The only thing the client cares about is the particle effect that the server spawns.

If you follow Part 3 of that tutorial, at 1:23 you will see that in action perfectly.