How to spawn an object only for a specific client using Unity Mirror?

1.1k Views Asked by At

NetworkServer.Spawn method spawns a gameobject, instantiated on server, to all clients. I have a canvas with UI for player. UI communicates with server through commands and RPCs. This canvas makes sense only to local player. There is no point in having these canvases instantiated on each player on client side. I`m trying to come up with a way to spawn one canvas for each player.

I`ve come across a suggestion to carry the canvas as disabled child object of player prefab and enable it with isLocalPlayer check. But I think that this solution is suboptimal for a type of game with loads of players.

0

There are 0 best solutions below