Basic Replication, Setting an owner to server?

Ive just started to dice into replication and I cannot for the life of me figure out this small little part. What i do in my code:
-Player pushed button, to call function “Cast Interaction Ray” in which the function is located in an Interaction Actor Component.

-From here we check if we hit something, and if this hit implements the “interaction interface”
-If it does implement the interface, then it’s “Interact” event/function in the actor
-From here we determine what to do, in this case, we attempt to ad it to our inventory, then destroy it

And that’s where it breaks down client side.

Now from what I’ve gathered, to call a RPC from some random object in the world, it needs to have an owner. To quickly attempt to get around this, right before I call the Event on the server i set the owner just to whoever is interacting with the object(im sure this is all bad/incorrect to do but just temporary to see if anything would change.)
Doing this allows me to call the event, and it does run. But even then in my code, its supposed to destroy the object which is doesnt do. Is it possible to just set the owner to the server? I’m curious what the CORRECT way to do this is! Or a decent tutorial because I cant seem to find anything with this scenario.

Any info helps! :slight_smile:

Setting a server as Owner is redundant since the purpose of Ownership is to allow Clients to send RunOnServer Remote Procedure Calls (RPC’s) to the Server or the Server to send RunOnOwner RPC’s to the owning Client if any.

A Server can always replicate variables or do Multicast Events on Actors that are set to Replicate while it is relevant to the specific Client.

Note that when you change Ownership (Set Owner) it has to be done by the Server. Client’s can’t change Ownership by themselves.
Also note that the Server has to Spawn actors that are replicated for the replication to work. If a client spawns a replicated actor it will work as a non-replicated actor.

Like with Spawn you should only Destroy Actors from the server and it will clean up the Actors on the clients.

Thanks for the help!

Still having issues though
So how can i tell the Server, from the Client, to destroy the actor? Currently my event(ServerRunInteract) is set to Multicast. All the code is ran correctly, but it will not destroy the actor on Client or Server(if player is a client)

This BP is from an actor that is placed in the world…

EDIT: is it having to do with my Interface thats causing an issue?

EDIT 2: OKAY i got it working. the issue was my player was calling a function in the “Interaction” actor component which was calling the interface function.
What i did to fix it was intstead of directly calling the interface function, i call a custom event on the server, which then calls the interface function.

Only issue i have not is objects that are placed via level blueprint are only being destroyed for the user that interacts with it, but objects placed manually work fine