Use of delegates in Blueprint and Network

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?

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.

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.

    UPROPERTY(Replicated)
    Type CurrentHouer;

    UFUNCTION(NetMulticast, Relibale) /// or Unreliable
    void NetMulticast()
    {
    OnTimeUpdated.Broadcast(CurrentHouer, CurrentMinute, CurrentSeconds);
    }

Thank you that clears that up.
Cheers!

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.