Function bound to a Timer Delegate won't properly execute NetMulticast functions

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.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

I actually got this setup to work by replacing the unreliable tag by a reliable tag on my MulticastFunction prototype. Still, I’d like to know whether it’s a bug or not :slight_smile: