Totally SOLVED how to get photon view or game object of owner
Options
Comments
-
partially solved
if anybody else needs this - only seems to work withPhotonNetwork.player.TagObject
InstantiateGameObject pl = PhotonNetwork.Instantiate (playerprefab.name, spawnPt.position,spawnPt.rotation, 0) as GameObject; pl.GetComponent<PhotonView>().owner.TagObject = pl;
to get the game object of the ownerPhotonPlayer p = photonView.owner; GameObject pp = p.TagObject as GameObject;
even when p does not return null, owner.tagObject returns null every time
Any ideas why tagObject doesn't work like this?0 -
i misunderstood how tag object works,
make sure you set owner.tagobject from void Start() on a script on the photon view and not during PhotonNetwork.Instantiate
this works:)0