photonView.find returns null

Options
hi guys, im trying to get a gameobject with a current viewId using :
PhotonView.Find(ObjectViewId)


this returns null , but the viewId is absolutly valid.


thanks in advance

Gal

Comments

  • vadim
    Options
    Hi,

    According to NetworkingPeer.GetPhotonView() code (which calls Object.FindObjectsOfType in turn), PhotonView.Find returns null if no active loaded objects found with PhotonView attached with given view id (check A code).

    Why you need that method at all?
  • thanks for your replay

    Im creating a multiplayer game and I have two users

    user one : creating a gameObject doing photonNetwork.instantiate();
    user two: need to find user one gameObject and to modify it.

    i find the gameObject user one has created


    maybe you have another idea
  • vadim
    Options
    You do not need to search for object. Attach scripts with handlers which run at different moments of object's lifetime depending on when you want to modify object (like Unity Awake, Start or many different Photon handlers like OnPhotonInstantiate). You can also store reference to object (this.gameObject) from inside the handler for future use instead of modifying object right away.