RPC doesn't work on repicated UObject

Hi there,

I am researching this topic as well and also implemented your referenced link.
I’ve looked right into the engine code and interestingly enough “CallRemoteFunction” of UObject simply returns false, while Actor and ActorComponent are implementing the function like this:

bool UActorComponent::CallRemoteFunction( UFunction* Function, void* Parameters, FOutParmRec* OutParms, FFrame* Stack )
{
	if (AActor* MyOwner = GetOwner())
	{
		UNetDriver* NetDriver = MyOwner->GetNetDriver();
		if (NetDriver)
		{
			NetDriver->ProcessRemoteFunction(MyOwner, Function, Parameters, OutParms, Stack, this);
			return true;
		}
	}

	return false;
}

First of all, I do not really know how RPCs are exactly created from the written code. But since UObject is not able to do RPCs, while Actor and ActorComponents can and these two inherit from UObject, there must be some function(s) which override(s) something from UObject to allow the known behaviour of RPCs.

As you can see there is a need of an Owner and further along if you want to differ your Role between ROLE_Authority or ROLE_… you will realize that UObject does not have a role. Problem is UObject does neither contain Owner nor a Role.

3 Likes