Actor Ref lost when passed to Server RPC

Hey all,

I’m running into an issue where an actor reference I have on the client turns to null when passed to a Server RPC.

Essentially building an Inventory system, where if a player interacts with a container, a Widget showing the items pops up. The player can then transfer items over to their inventory widget.

The container is not NetOwned by the player. I managed to circumvent that by calling the Transfer Item Server RPC on the player character taking Container reference.

The issue is that when OnDrop executes and forwards the necessary data to the Server RPC, the Container ref is null on the server side.

I can tell that the ref is correct on the Client side, but null on the server based off the Print Strings. I’ve been scratching my head at this one. When looking at the Network properties of the Item container, everything look right:

The Inventory component is also set to Replicate. This Item container is placed in the world, not spawned.

I’d appreciate any leads I could follow, or reasons why this might be occurring.

Thanks in advance!

it means the variable itself is not replicated, you can see by the double white dots in the topright of the variable.

UE actually resolves the Objects/Actors GUID and sends that over the network when sending an object reference.

Once the RPC arrives, the engine resolves that GUID back to the actual reference.

Meaning you can only pass in replicated objects that exist on both client and server.
Note that this also only works if the owner of the object/component is replicated as well.

E.g. sending the reference of a non-replicated component that lives on a replicated actor will fail.
Both need to replicate for it to work.