# Multicast Event not running on the clients!

**URL:** <https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384>\
**Category:** Multiplayer & Networking\
**Tags:** rpc, unreal-engine, Blueprint, question\
**Created:** [December 6, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384 "2023-12-06T14:05:31Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![BiaXThePanda1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BiaXThePanda1](https://forums.unrealengine.com/u/BiaXThePanda1)\
**Post date:** [December 6, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/1 "2023-12-06T14:05:31Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/1/8011d3eab7e62c9a0a184a11b73bfc4099636d0d.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/8/8e847e3c85b985ef23d64cd577b22a004eed6e69.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/5/b957a3375d9a3b1e2b18ac4274e78744f4410b11.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/8/5e825cbd275c701ec2fe92e75db2378c75815316.png)

As you can see i am spawning a replicated actor called “SymbolPassword” from another replicated actor with switch has authority. But in SymbolPassword the MS multicast event doesnt run in the clients. Eventhough the MS is multicast and reliable. How can i solve this ?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 6, 2023, 5:59pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/2 "2023-12-06T17:59:45Z")

</div>

Client has to exist in order to receive RPC’s.

Loading order is server loads level. Level creates Game mode and Game State. Game mode then spawns and possess pawn for each connection. Pawns are replicated over along with what level to load to each connected client.

Client receives packet, starts loading level and spawns pawn.

Note !!! In most cases (99%), the Pawn will be spawned on clients before the level is sufficiently loaded.

---

<div class="post-metadata">

**Author:** ![BiaXThePanda1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BiaXThePanda1](https://forums.unrealengine.com/u/BiaXThePanda1)\
**Post date:** [December 14, 2023, 9:20am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/3 "2023-12-14T09:20:41Z")

</div>

Thank you. I’ve realized that multicast events doesn’t work on EventBeginPlay most of the time since they dont exist at that time. Is there a way to trigger those events after the clients entered the game and they all exist instead of calling them in EventBeginPlay ?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 14, 2023, 6:56pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/4 "2023-12-14T18:56:54Z")

</div>

You will need to create a “ready” state that reports back to either game mode or game state. When all have reported back call a multicast event.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 15, 2023, 3:19am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/5 "2023-12-15T03:19:00Z")

</div>

depending on your goal you can always use repnotifey too which is also more efficient than multicasts

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 15, 2023, 5:33am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/6 "2023-12-15T05:33:45Z")

</div>

You’d have to loop through the player array to set a rep\_notify on each. If you have 10 players that’s 10 values in the replication packet. Multicast would be 1 RPC call on each owning client.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 15, 2023, 7:44am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/7 "2023-12-15T07:44:38Z")

</div>

huh? you just set it on server and it’ll only replicate when it can, RPC especially reliable ones can cause client desync

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 15, 2023, 7:15pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/8 "2023-12-15T19:15:36Z")

</div>

There’s always desync in multiplayer. Even on LAN there’s ping variance, then game and render thread variance. Rep\_notify variable won’t mitigate desync.

* * *

Op is trying to execute logic when the player has loaded. Special event. In order for the server to know when a client has loaded you need the client to tell the server it’s ready.

Ops other constraint is one and done. One RPC call to handle all clients. Thus multicast.

Rep\_notify requires the creation of a variable and a function that will persist. Thus is bloat. A dispatcher call to the server is a one and done per client. You can even unbind it when done. Once all are ready the server can fire a single event that executes logic on every client. No loops, no passing variables etc. The packet will have a simple event call in it.

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [December 15, 2023, 8:14pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/9 "2023-12-15T20:14:25Z")

</div>

Replicated variables should always be used when changing a state in the game rather than using a Multicast RPC since RPC can and will desync while OnRep variables are reliably replicated.

The only downside to replicated variables is that intermediate changes might be dropped but this is also what makes variables that change often much more lightweight than RPC’s.

Multicast RPC’s should only be used if you are doing an instant action like playing a sound or animation or notification that only matters right when it happened.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 15, 2023, 9:51pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/10 "2023-12-15T21:51:11Z")

</div>

Say I wanted to load a special UI on all clients. Yet, only when all clients are ready. This is a one time event and will never happen again. Initialized from the server.

Would you still use Rep\_Notify or would you instead look at Event Dispatcher or Multicast (Reliable)?

If I’m doing character cosmetics, door states, health, ammo, score etc… Rep notify all day, every day without a second thought.

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [December 15, 2023, 10:11pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/11 "2023-12-15T22:11:12Z")

</div>

RPC’s that are called when a client is having connection issues and reconnecting will be dropped even if reliable and since a client can have issues at any moment I would probably use a variable unless if the UI is not important later on.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 15, 2023, 10:37pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/12 "2023-12-15T22:37:15Z")

</div>

I’m fully aware of network issues will result in a chance the multicast is not received on lossy clients.

I’m looking at an approach to have all clients load specialized functionality etc in a one off call from the server (passing specialized info). Info is the same for all clients.

Doing it with Rep\_notify adds a variable and a function to the character class. Variable will also be added to replication graph and checked every pass.

For giggles lets say the specialized info is a row name from a data table. The OnRep function would look up the row and add an Actor Component to the character class, then set a reference. That’s it. From there onward the row name has zero value. The variable will never be updated again, nor the function run again.

Using rep\_notify here would require the server to loop all players and set the rep\_notify for each. 100 players = 100 iterations of the loop, 100 vars replicated out to every client (gotta keep them sims updated). Then role checks etc added to the onrep function to ensure only the client-side autonomous executes the logic.

At that point wouldn’t it be better bandwidth and net saturation wise to build a polling function using component reference validation as control for row request?

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [December 15, 2023, 11:12pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/13 "2023-12-15T23:12:15Z")

</div>

You can always use net dormancy or the push model to prevent the constant checks when you want to optimize.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 16, 2023, 4:25am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/14 "2023-12-16T04:25:27Z")

</div>

dont get me wrong either would work in this situation but like Garner said i only use RPC for effects like sounds etc which also dont need to be reliable and you can drop them safely without effecting the game.

in this particular case i dont see why you couldnt just use the beginplay since this will only run on client when the client is loaded anyway. in my experience variables are replicated before client begin play is called so everything should be set to go, although i havent tested that extensively.

i think the real question is what are you trying to multicast and why?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 16, 2023, 6:06pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/15 "2023-12-16T18:06:34Z")

</div>

> [@Auran131](#):
>
> in this particular case i dont see why you couldnt just use the beginplay since this will only run on client when the client is loaded anyway.

Because the server is firing an event before the pawn exists on the client. That’s the whole point of the client notifying the server that it is ready. Not all load in fast. Varying hardware/software, background services, apps etc.

Look at Battlefield for example. Pre-round all clients have to ready up before the game start countdown starts ticking. Thus each client has to call the server to notify it. When all have readied up, the server fires back an event to start the countdown.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 17, 2023, 2:34am UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/16 "2023-12-17T02:34:30Z")

</div>

i was referring to the client begin play not the server begin play which will obviously fire when loaded on the client.

but again this depends on what the OP is trying to achieve

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [December 17, 2023, 4:25pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/17 "2023-12-17T16:25:31Z")

</div>

> [@Auran131](#):
>
> i was referring to the client begin play not the server begin play which will obviously fire when loaded on the client.

In Ops post he’s firing a multicast on the server, but some clients aren’t receiving it because the pawn doesn’t exist yet.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 16, 2024, 4:26pm UTC](https://forums.unrealengine.com/t/multicast-event-not-running-on-the-clients/1496384/18 "2024-01-16T16:26:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
