Here is my setup :
MyClass.h
// Called server-side
void ServerFunction();
void TimerDelegateFunction();
UFUNCTION(NetMultiCast, unreliable)
void MulticastFunction();
MyClass.cpp
void AMyClass::ServerFunction()
{
// This multicast call works properly
MulticastFunction();
TSharedPtr<FTimerHandle> TimerHandle = MakeShareable(new FTimerHandle());
TSharedPtr<FTimerDelegate> TimerDelegate = MakeShareable(new FTimerDelegate());
TimerDelegate->BindUFunction(this, FName("TimerDelegateFunction"));
GetWorldTimerManager().SetTimer(*TimerHandle, *TimerDelegate, 3.0f, false);
}
void AMyClass::TimerDelegateFunction()
{
// This multicast call is executed on server but NOT on clients
MulticastFunction();
}
void AMyClass::MulticastFunction_Implementation()
{
// Do something
}
As you can see, what I try to achieve is to call a NetMulticast function from a function bound to a Timer Delegate. While my MulticastFunction function works properly (called on clients) when called from ServerFunction, it does NOT work when called from TimerDelegateFunction (although the function being run server-side).
Is my understanding not correct, or is it a bug?
Cheers.