Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can a client call a ClientRpc on every other client?

Discussion in 'Multiplayer' started by andysctu, Jun 8, 2016.

  1. andysctu

    andysctu

    Joined:
    Jun 14, 2014
    Posts:
    20
    I'd like for a client to call a ClientRpc on every other client (send everyone a message, etc).

    The way I am currently doing this is I am sending a Cmd to the Server with the message, then I have the server call a ClientRpc to relay that message to everyone.

    Is there a direct way to go from client -> clients, instead of client -> server -> clients?

    Thanks
     
  2. Oshroth

    Oshroth

    Joined:
    Apr 28, 2014
    Posts:
    99
    Clients, by default, don't know about the other clients. Only the server keeps track of the client connections.
     
  3. Bmandk

    Bmandk

    Joined:
    Aug 18, 2012
    Posts:
    70
    Yes, this is true. On top of that, UNET doesn't allow you to call Rpc's from clients. Rpc's are a way to sync out a message from the server to all clients.

    What you can do, is call a Command that in turn calls an Rpc. This is essentially the same, just with the need to first get it to the server.