Download

OnRep only called on one client

Ok, so a little bit of background. I am attempting to setup multiplayer on our game using a the dedicated server option with 2 players (at the moment).

There is a function that is called client-side on the press of a button. This function that is called on the client, then proceeds to trigger an RPC to the server. Inside this RPC to the server I am spawning an actor which I have an OnRep setup for via ReplicatedUsing. However, the OnRep function is only seemingly executed in one “place”. I can tell because if I print the name of the player controller it is the same each time the OnRep is called, no matter which client initiates this whole flow by pressing a button.

How can I make it so that this OnRep is executed on each individual client?