# Use of delegates in Blueprint and Network

**URL:** <https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, unreal-engine, delegates, CPP, Blueprint, question\
**Created:** [August 11, 2014, 1:25pm UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685 "2014-08-11T13:25:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_6334e343](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6334e343](https://forums.unrealengine.com/u/anonymous_user_6334e343)\
**Post date:** [August 11, 2014, 1:25pm UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685/1 "2014-08-11T13:25:08Z")

</div>

I made a new delegate, like this.

```
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FGameStateTimeOfDayChanged, uint32, Houer, uint32, Minute, uint32, Sec);

```

And then i added it to my class like this.

```
UPROPERTY(BlueprintAssignable, Category = "Time Of Day")
	FGameStateTimeOfDayChanged OnTimeUpdated;

```

Then in the method i have in my Game State class to update the time, i want to Broadcast / “Send” the event. (The method where i use ::Broadcast(,) is only ever called on the server.)

```
	OnTimeUpdated.Broadcast(CurrentHouer, CurrentMinute, CurrentSeconds);

```

But the problem is that i can only see the delegate fire on the server, but should they not also fire on the clients as they also have the GameState and its Broadcasted from the server?

I know for a UFUNCTION() i can use NetMulticast to have the method execute on all clients.  
Is this not the same for MULTICAST Delegates?

---

<div class="post-metadata">

**Author:** ![Duncan\_Dam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duncan\_Dam](https://forums.unrealengine.com/u/Duncan_Dam)\
**Post date:** [August 12, 2014, 8:53am UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685/2 "2014-08-12T08:53:02Z")

</div>

I think delegate it’s kind of like an event, and you still need to tell the event to run on client, server or netmulticast, i don’t know exactly multicast use for though.

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [August 12, 2014, 9:48am UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685/3 "2014-08-12T09:48:54Z")

</div>

Delegates are not replicated.

Executing delegate from server, on clients it’s bit tricky, need some forethought and invovles writing quite a bit of supporting code.

1. All data you will try to send trough delegate, will need to be replicated. DOREPLIFETIME or other macro, depending on how you want to replicate it.

2. Then you will need to use NetMulticast or Client RPC call, trough function. Depends if you want to execute delegate on all clients or only on owner. On your RPC function you simply Broadcast delegate.

3. Another option is using RepNotify, Depending on your needs it might be enough. I would experiment with both and see which will be better for you. RepNotify tends to be more lightwieght for networking, but it is also less reliable, than RPC.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6334e343](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6334e343](https://forums.unrealengine.com/u/anonymous_user_6334e343)\
**Post date:** [August 12, 2014, 10:27pm UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685/4 "2014-08-12T22:27:04Z")

</div>

Thank you that clears that up.  
Cheers!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6334e343](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6334e343](https://forums.unrealengine.com/u/anonymous_user_6334e343)\
**Post date:** [August 13, 2014, 11:01pm UTC](https://forums.unrealengine.com/t/use-of-delegates-in-blueprint-and-network/290685/5 "2014-08-13T23:01:13Z")

</div>

You are correct, what i ended up doing is Broadcast the event a second time when OnRep\_CurrentSeconds is called. That way i did not have to send the data twice to get actors with no GameState to be able to pick it up.
