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

RPC for specific player or to all players

Discussion in 'Multiplayer' started by Femidko, Jul 7, 2015.

  1. Femidko

    Femidko

    Joined:
    Aug 4, 2013
    Posts:
    55
    Good afternoon!

    Everything is clear in the work of server command and client RPC. However, usually for security, I share client and server code in the different classes. What to do in this case? How to send RPC from server to specific player or to all players?
     
  2. powdered_swords

    powdered_swords

    Joined:
    Mar 11, 2013
    Posts:
    28
    client RPC calls cannot be sent to specific players currently. Try network messages. You can send messages to specific players using NetworkServer.SendToClient.