Hi,
I have an interface with RPC client functions such as
UFUNCTION(Client, reliable)
virtual void Func();
Overriden by a class with void Func_Implementation() override;
It all compiles and startup fine except the function is being run on listen server on testing.
i.e., 3x players will call this function 3 times on server. I can try moving the UFUNCTION def to implementing class but hoping there is a better way by keeping it in interface.
I tested the same code using another rpc function on the implementing pawn class. The function was called from server using pawn class instead of interface. it worked as intended by running on the client.
The function ran incorrectly on server instead if I call Interface->Execute_Func(Pawn) from server.
RPC’s in an Interface class will not execute from clients → server. Interfaces are not owned by client actors. You have to either put the RPC in the Controller/Character (preferred) or in an actor that is outright owned by the character/controller.
Based on other forum/bug reports that’s what I assumed. Thanks for clarifying.
The build should assert if RPC functions are defined with interfaces to show that it is not supported.