Unity.Networking (UNet) RPC to Specific Player? Master Server?

Just a couple of questions in regards to the new UNet system.

First, is it possible to send an RPC to a specific player? For example I have a chat system which allows sending messages to everyone, a specific group like a clan or party, or whispering to a single player. Is this done with the [Command] and [ClientRpc] attributes or with SendToClient()? If any one has any general pointers I would greatly appreciate it!

Also my second question: My game currently relies on a masterserver. Is there a masterserver aspect to UNet, or only direct connect?


There is a “TargetRpc” being added to UNet that does this - probably in 5.4

Currently ClientRPCs will be sent to all clients and not only one of them. This is a good feature to be added however. In Client if you want to receive only at owner side you can check isAuthority to see if you should process the call or not but it means everyone will receive it and only owner processes it.

To send a message to a particular client: http://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SendToClient.html

For MasterServer-type functionality, see: http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html