Multicast not running on client

I’m having some issues with some networking code currently.

Here is code that is running: Screenpresso Cloud

And here is resulting output: Screenpresso Cloud

You can see from prints that multicast event is being called from server, but then after multicast still is only running on server. I have used a similar setup a few other places in my project and it works fine, I’m not sure why this one is different. Are there other things that affect whether a multicast event will be executed on clients?

Hey ,

I wasn’t able to reproduce this behavior. Are you able to reproduce this in a new project, or does it only happen in your current project? If you can reproduce in a new project, please provide some exact steps for me here and I will attempt to find source of problem here. Thanks!

I did actually manage to produce it in a bare bones project.

It has 2 classes:

TestObject - Screenpresso Cloud

MyCharacter - Screenpresso Cloud

result is that server (and ONLY server) will print ‘Should Print This On All’.

Not sure if this is me misunderstanding networking, or if it’s a bug, would love to know which!

Okay, I tried this in a new Third Person template project with BPs set up as you described. When I started PIE (with Number of Clients set to 3) and pressed LMB in any window (client or server), it printed Server: “Should Print This On All”, meaning Server printed string to all Clients. Is that what you are getting, and do you expect something else?

I think what you’re running into is that you have two Events that you’re setting replication on, and how you have each set effects other in chain. So when you click LMB on any client or server, with OnServerLeftMousePressed set to Run on Server, MyCharacter BP is telling only Server to run MulticastPrintTest function, which is then replicated to all clients.

Yes that’s what I was getting, and I was expecting each client to print it themselves. It looks like my understanding of multicast may be wrong.

I essentially expected that if a multicast event was run by server, it would force each client to run that code itself, thus each client would print string.

way it is currently, if event in ‘TestObject’ is set to ‘no replication’ or ‘multicast’ it doesn’t change outcome at all.

Translating test to an actual project, train of logic is:
‘Server determines event occurs, tells clients to spawn their own particles’.
My understanding was to use a multicast there, which would allow server to force all clients to spawn their own particles, at current they only appear on server (as print does in this example).

Note if you shift multicast from object to character itself, it behaves as I expected. So this logic here: Screenpresso Cloud

Prints ‘Does actually print on all’ from each client on every screen. I’m unsure why that doesn’t occur when you call it on another object.

Hi ,

I apologize for delay in responding, this post got lost in my stack somehow.

I think problem you’re running into is that your TestObject isn’t set to replicate, so it only exists on server. Go to Blueprint’s Defaults tab and enable Replicates. When you run it this way, server and then each client should print “Should Print This On All.” Let me know if that doesn’t work and we’ll take another look.

1 Like