Search Unity

Question What's the best way to pass info from Host/Server to a Client?

Discussion in 'Netcode for GameObjects' started by GuirieSanchez, Dec 11, 2022.

  1. GuirieSanchez

    GuirieSanchez

    Joined:
    Oct 12, 2021
    Posts:
    452
    Imagine I want to set +50 parameters from the server to a client (it'd include multiple types: bools, ints, floats, vectors, etc.). What would be the best practice to accomplish this?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,956
    ClientRpc with custom INetworkSerializable struct.
     
  3. GuirieSanchez

    GuirieSanchez

    Joined:
    Oct 12, 2021
    Posts:
    452
    Hi @CodeSmile, thanks for answering. Could you provide a little example of it?