Can't get View ID of GameObject
Options
So I have a player prefab with a PhotonView on it. I also have this code on a collider...
Can anyone see why this would not work. I have using Photon.Pun; and MonoBehaviourPun but I get the error....
error CS1061: 'PhotonView' does not contain a definition for 'viewID' and no accessible extension method 'viewID' accepting a first argument of type 'PhotonView' could be found (are you missing a using directive or an assembly reference?)
Thanks
if(other.gameObject.GetComponent<PhotonView>().IsMine) { GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); Debug.Log(players[1].GetComponent<PhotonView>().viewID); //BROKEN HERE }
Can anyone see why this would not work. I have using Photon.Pun; and MonoBehaviourPun but I get the error....
error CS1061: 'PhotonView' does not contain a definition for 'viewID' and no accessible extension method 'viewID' accepting a first argument of type 'PhotonView' could be found (are you missing a using directive or an assembly reference?)
Thanks
0
Comments
-
Wow so I'm dumb and the answer was "ViewID"
players[bountyIndex].GetComponent<PhotonView>().ViewID);
A bit worrying that this forum couldn't help me out with that. Doesn't fill me with hope when I have an actual difficult question.0