Multiplayer Spawn / Owner

Hello all,
am relatively new to the Unreal Mutliplayer topic and just have question about spawning and ownership of actors.
The issue is that both the server and each client that connects spawns a sphere at the beginning, which he can move with the mouse. So each player is master of his own sphere.
My first approach was as follows:

In the Player Pawn at BeginPlay → Spawn Actor and at then set its Owner → Self…

Does anyone have an idea or an approach how something like this could work?

Thanks a lot in advance.

Or in other words how can I spawn something on the server and set its ownership to client?

Anything “spawned” on the client, is owned by the client. The server will have no real authority over it. An actor that is spawned by the server is owned by the server.

On the server … switch has authority (Authority) → Spawn actor from class (set owner pin).

Generally you are looking at calling an event (RPC) to run on server. That event will run the switch and spawn the new actor. Actor class being spawned must have “Replicates” ticked if you are passing ownership.

2 Likes

Thanks for the answer.
Assuming I spawn the object in Pawn, my function looks like this:
Begin Play → CustomEvent(ExecuteOnServer) → SpawnActorFromClass (Owner: Self).
If I do it this way, the object will be spawned both on the server and on the client, but the client will no longer have control over it. In contrast, if I set the Custom Event(ExecuteOnClient), the client has control over it, but the server does not see it…

This is my approach right now