Howto have server set actor owner to player controller?

I had this question How to know if listenserver/client, owner for rpc? where I got a very nice answer.
Now I want to use more of that answer and to be able to do that I have the following question:

How do I have the server set the owner of an actor to the player controller I want?
In my case it should be very easy, I just don’t get it.

I want:

  • a spawner class which is (like the playercontroller) able to rpc
  • the spawner class blueprint will just be put into the level from the editor, or is that already the wrong first step?
  • the spawned actors shall be owned by the client (I’ll have the same name for them on all clients, so I can rpc (validate) actions across server/clients, works already)

My problem is the spawner class. How do I set it to be able to rpc?
I tried
pSpawnerClass->SetOwner(pPlayerController->GetOwner() )
but either it crashes everything or does nothing at all.
I even put it into the first tick event because as read somewhere that ownership is not correctly set in BeginPlay but in Tick.

I am currently working around this and “misusing” the PlayerController for a lot of things.
I’d like to have an answer I can use the next time I have to do something like this.

Btw, thanks for reading through the wall of text until here :wink:

I have the same issue in Blueprint. I can’t tell an actor what is his owning connection. I tried with Set Owner and the input parameter “Owner” when spawning it but it didn’t work. The actor is always owned by the Server, no matter what I do.