Search Unity

How does a RPC work?

Discussion in 'Multiplayer' started by Christian-Tucker, Oct 17, 2014.

  1. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    --Snip
     
    Last edited: Oct 19, 2014
  2. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124
    Conceptualy you are right, in unity RPCs are always reliable anad ordered so you are guaranteed to receive updates currectly. Because you are not buffering it the future players will not receive it. Your character will be instantiate d in the however if you use Network.Instantiate since in unity's networking (built in one) you can not filter buffered RPCs at execution time.
    You can even write this method as a setter for a property and sned the rpc there so whenever someone sets the health property it will be called but it's hiding what actually is being done probably .

    Hope this helps (I said conceptually since i'm too tired of being capable of checking for small bugs)