(Multiplayer) How can you make the client affect non player objects?

I’ve been using Unity for a while now, learning as I go, but this is the first real time I’ve struggled to find anything online to help and I’m kind of stumped.
For the last few months I’ve been working on a small zombie survival game. It’s has a similar concept to the Call of Duty zombie modes, so you basically have to survive wave after wave of enemies. A couple of weeks ago, I started trying to make it multiplayer for 2 to 4 players (coop).

I’d like to think that I’ve gotten most of it working, but I’ve hit an issue. The problem is that the client can kill enemies, but this does not show up for the host. However, when the host kills an enemy, the enemy will die for both players.

My problem (I think) is that I don’t know how to send a ‘message’ from the client to the host (whether that is dealing damage to an enemy or spawning an item, etc.)

I’m 90% sure that there’s something simple that I’m missing, but I’ve been looking around and so far nothing seems to work. But really, more so than just a fix (which would be very appreciated), I’d like to understand what I’m doing wrong (or not doing).
Thank you very much in advance,

(Also if anymore information is required (code, or anything else) I’d be happy to share, but I don’t exactly know what would be needed)


Do you know whats [ClientRpc] (Commands called by server but executed only in the clients) and [Command] (commands called by clients but executed only in the server) ?

You should take a look here :smiley: Read/watch it all, and will understand how servers and clients work.


Accept the ansewr please!