Blueprint SetOwner node does not allow client to call RPC

Hello Community,

I’m testing this in the third person template. I have the server spawn a pawn with no owner. This pawn has a test RPC (run on server) that just prints “Hello”. When the client logs in he searches for the spawned pawn in the Authority side of his BeginPlay. When the controller finds the pawn he calls the SetOwner node to set himself as the Pawn’s owner. Note that he does this from the SERVER side of his BeginPlay event. He also stores a replicated reference to an internal MyOwnedPawn variable.

It’s my understanding that at this point the client controller is now the NetOwner of the server spawned pawn and thus should be able to make RPC calls on it. However that is not happening. When I call MyOwnedPawn’s TestRPC from a button press it does not execute at all. I have even checked that MyOwnedPawn’s owner and my Self reference are indeed the same object on both server side and client side - and they are.

I really need this to work. Bridging through the player controller or the controller’s possessed pawn is not an acceptable answer for me.

Can someone help educate me on this? I’ve scoured the answerhub and the forums. There are several mentions that this should be working but they are all using C++. Is there a known issue with the blueprint SetOwner that would prevent this? As I mentioned above I am calling SetOwner from the server side code - not from the client. That is the only caveat I’ve seen mentioned for making this work.

Many Thanks

here the chat actor, spawned on server without owner but then set the owner and use run on server events

Hello CriErr,

Thank you for responding, but the example you use is bridging the RPC call inside the PlayerController via the AddMessageforSend. Note that you have this set as execute on server. This is exactly what I’m trying to avoid. I need the PlayerController to be able to make RPC calls directly on an actor without having to bridge inside the controller.

With that said, it is a cool example. I like the chat system and I may steal that RenderCustomDepth thing you did. I had not seen it before. :slight_smile:

Thanks!

You cant, i didnt found the way, if you would found one, message me.