Download

Problem with event replication on a dedicated server

Hi,

I try to create a multiplayer FPS game whith a dedicated server. The idea is to have some cube on the game and each player have to touch them to change the color.

I create on trigger over the cube and when someone enter in trigger the color of the player is given to the cube. To have no cheat I want the server check and choose the color.

I do just the bone of my blueprint code like this to simplify my question :

fbaa708af363b04d2006f5b587acedff2490cf6a.png

My problem is when a player enter in trigger ONLY THE SERVER print “Done”… My event is “multicast” so I don’t understand…

Why ???

Only the server print “done” on his viewport or all clients get “server: Done” on their viewports? because if all, then its good.
If first case, then first try to “run on server” event and then call multicast (multicast is called only if its called by server)

All clients get “server: Done” on their viewports…

My problem is the complete CustomEvent_0 is to change the cube color and when I put this just after the “OnComponentBeginOverlap” my cube change the color on each player but when my event is like below after the multicast event I have no color change on player viewport.

So, is that actor replicated? class defaults -> replicate
You can also try:

  1. remove node switch has authority
  2. first use “run on server” RPC and then “multicast”

I have setup something like this, i drive it from tick and after some condition i use multicast to sphere material and it works…

Thanks, I try your solution like this :

Capture.PNG

The “PlayerEnterInTrigger” event call the “MulticastEvent”.

And the prints are :

  • Server : Analyze by Server
  • Server : Done

I don’t understand why only the server print “Done”…

Any idea ?

You need server to call MulticastEvent from RunOnServerEvent