Search Unity

How to find network object instance?

Discussion in 'Multiplayer' started by Neodrop, Jan 23, 2009.

  1. Neodrop

    Neodrop

    Joined:
    Oct 24, 2008
    Posts:
    1,359
    In my application, I need to find the networking player "body" for realisation of some actions.
    How can I find my gamers body (Transform or GameObject) by the ViewID or Network Player ?
     
  2. lrtitze

    lrtitze

    Joined:
    Aug 27, 2008
    Posts:
    13
    I use the following to get the transform:

    Code (csharp):
    1. var playerNetView : NetworkView = networkView.Find(playerNetViewID);
    2. var thePlayer = playerNetView.transform;
     
  3. Neodrop

    Neodrop

    Joined:
    Oct 24, 2008
    Posts:
    1,359
    Thanks.
     
  4. Neodrop

    Neodrop

    Joined:
    Oct 24, 2008
    Posts:
    1,359
    How can I test what my object with given NetworkViewID is exist?
    if I deleted this object by other script, networkView.Find(NetworkViewID) method return me error...