Can I send object via RPC?

Options
I'm guessing not?
The object would either be a GameObject, Vector2, or null.

Comments

  • chaozz
    Options
    you can not. but an effective way is to use the name of the GameObject.
    string nameGO = GameObject.name;
    then inside the RPC you can GameObject.Find (nameGO);
  • What if multiple GOs have the same name? Then there's a chance it would find the wrong one.
    I think the best thing would be to index all GOs in a collection and send the index.
  • vadim
    Options
    You can send either some data (like object properties) or network object id to reference instance of this object on other client.
    So it's not clear how you are going to 'send object' and for what purpose.