It seems to me that interface functions marked as NetMulticast defined in C++ only run on the Server when invoked from the Server.
I made an example:
test_if.h
#pragma once
#include "CoreMinimal.h"
#include "system/utils/log.h"
#include "test_if.generated.h"
UINTERFACE(BlueprintType, NotBlueprintable)
class MEMER2_API UTestIf : public UInterface { GENERATED_BODY() };
class MEMER2_API ITestIf {
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
virtual void do_something();
virtual void do_something_Implementation() { }
};
test_actor.h
#pragma once
#include "CoreMinimal.h"
#include "test_if.h"
#include "test_actor.generated.h"
UCLASS()
class MEMER2_API ATestActor : public AActor, public ITestIf {
GENERATED_BODY()
public:
ATestActor() {
bReplicates = true;
}
virtual void do_something_Implementation() override {
log_to_screen("Called do_something");
log_to_screen(FString::Printf(TEXT("%s"), ANSI_TO_TCHAR(HasAuthority() ? "Server" : "Client")));
}
};
(The cpp-s only include the headers.)
And then i just spawn the actor somewhere where I am certain it gets set up for replication:
And the result:
(I create 2 actors present both in the listen server and the client.)
So it seems the NetMulticast functions defined in an interface dont get called on clients.
Am I doing something wrong, is this intended behaviour or a bug?