RPCs within an actor owner hierarchy

Hi,

I am trying to understand this paragraph taken from A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

In unmodified Unreal an Actor can invoke a Server RPC if there is a UNetConnection (i.e. a Player) in its owner hierarchy, therefore ONLY a Player or an object owned by a Player or its children (PlayerController, etc) can invoke a Server RPC.

What exactly does this mean? I have tried something like the following

ServerSpawnedActor->SetOwner(ClientPawn);

And ServerSpawnedActor does not receive any RPC calls (its role is simulated proxy). That description says to me that since SeverSpawnedActor is part of the ClientPawn owner hierarchy, RPC calls should be allowed on it by the client who owns ClientPawn.

By the same logic, this should also work:

ServerSpawnedActor->SetOwner(ClientPawn);
AnotherServerActor->SetOwner(ServerSpawnedActor);

With the hierarchy now looking like this:

ClientPawn
|_
  ServerSpawnedActor
  |_
    AnotherServerActor

To me, AnotherServerActor is part of ClientPawn’s owner hierarchy, and this should also be allowed to have RPCs called on it.

Am I misunderstanding this? It doesn’t seem to matter what I try, ClientPawn is the only actor to ever have the autonomous proxy role, so it seems as though the owner hierarchy doesn’t do what I think it does. The API entry for SetOwner() says it is for replication purposes, does this not include RPCs?

EDIT

Done some more testing, and it seems the following is true:

  • A component of an actor owned directly by the pawn cannot have RPCs called on it. This is what I was doing, which caused the RPC to fail even though the actor is an immediate child of the pawn.
  • Only immediate children of the pawn work. That is, the owner hierarchy can only be 1 deep, which means the second hierarchy I gave above will not work.

This is a little bit unfortunate, since this means I am having to add a custom UNetOwnerComponent that will iteratively check owners until it finds the pawn (which will not have the component) and use the pawn as the actual parameter to SetOwner(), rather than the supplied actor in order to allow me to create ownership hierarchies that respect the network role of the outer most actor in the hierarchy (which will be the pawn).

Is there any way to do this natively or is my UNetOwnerComponent solution the only to make this work?