void OnTriggerEnter2D(Collider2D col) { proxy = col.GetComponent <PhotonViewProxy>(); if (proxy && proxy.photonView.Owner != this.photonView.Owner) { print("Player hit proxy " + proxy.name); if (proxy.photonView.GetComponent <Player>() == null) { print("This proxy has no player component..."); photonView.RPC("takeDamage", RpcTarget.All, amount); } } }
void OnTriggerEnter2D(Collider2D col) { // print( "Bullet hit " + col.gameObject.name ); // col = GetComponentInChildren<Collider2D>(); proxy = col.GetComponent <PhotonViewProxy>(); if (proxy && proxy.photonView.Owner != this.photonView.Owner) { PhotonNetwork.Destroy(this.gameObject); //Debug.Log("hit other player"); } else if (col.tag == "Wall") { PhotonNetwork.Destroy(this.gameObject); } }