void Start() { PlayerCtr = FindObjectOfType <PlayerContrl>(); pv = GetComponent <PhotonView>(); if (!pv.IsMine) { PlayerCtr = FindObjectOfType <PlayerContrl>(); pv.transform.parent = PlayerCtr.transform; } if (pv.IsMine) { PlayerCtr = FindObjectOfType <PlayerContrl>(); pv.transform.parent = PlayerCtr.transform; } }
// Start is called before the first frame update void Start() { //playerCtrl = GameObject.Find("Hero").GetComponent<PlayerContrl>(); playerCtrl = transform.parent.GetComponent <PlayerContrl>(); }