Hello guys, I have a simple issue that is blocking me.
I can’t get around how to pass a UObject (ItemObj in screenshot) using a server RPC, it always returns null yet everything else is passed correctly. I have even tried to pass it by reference as I thought it might be a pointers issue in the blueprints background.
@TechLord Thank you for your reply. Yet I read couple posts saying that UObjects don’t replicate and passing them to RPC will always result in them being null. On the UObject level, replication starts from AActors.
Apparantly you can override that in C++ while coding but not in Blueprints modeling. I am trying to find a workaround.
So I just realize you are trying to pass an ‘object’ not an aactor. It may not be working because replication starts from AActors. So try passing an AActor, not an object. If the object is just a container for basic datatypes or structs with basic datatypes, try passing the basic datatypes from the object over.
It may also related to where you are trying to send the RPC from, is it a Player Character or Controller?
I ran into something similar a while back. I could not pass the object/actor no matter what, so my workaround was to cache [object name | integer ID ] - to - object reference map on Server/Clients for a performant lookup, then pass the [Object Name|Integer ID] instead of the Object Reference. The Object Names should match up on server/clients. I did not fiddle with C++.