Net mode. Actor is spawned only when playing as listening server but on both clients

So i have the following settings:

image

With the netmode set to “Play as client”.

Now in my gamemode i run the following:

When i do this i can’t see anything on either clients.

However when i change the netmode to “Play as server” both of the instances of the game i have can see the spawned object.

Can anyone explain why / whats going on?

To start… …still learning multiplayer… …however…

Try keeping “Spawn_mission” as “Executes on Server”. Have this event call another event like “MulticastSpawnMission” which “Executes On All”. Have this new event spawn the actor. This should cause the actor to be spawned on both the server and the clients.

Another thought… …your KillMission actor might not be replicating. There are check boxes on the Actor component, self, to indicate that it “Replicates”. Something else to check/try.

The actor that is being spawned needs to have “Replicates” ticked.

Class Settings… Replicates.

Then it will spawn on the server and the replication system will replicate it on all relevant clients.

The NetCullDistance of the actor helps determine who is relevant.

You GameMode cannot have a “Run on Server” event.
First off, Gamemode only exists on server side, so there’s no way a client can call the function like “GetGameMode → Spawn_mission”.
Secondly, client-to-server RPC events are only accepted when called by the client who is considered to be the Owner of the actor. Gamemode has no owner.

The only reason it works when playing in Standalone or Listen Server is because the host is client and server at the same time, so Gamemode exists for the host and “Run on Server” events will go through.

I don’t know what logic you use to call the Spawn_mission event. If possible, use server-only logic (things like collision/overlap detection do trigger on server, you don’t need client-to-server replication to detect that). If however you need to call it strictly from client input, then you have to route the client-to-server RPC call through an actor owned by the client, such as its PlayerController, PlayerState, or Character.