- Home /
[Photon] collider's owner's myphotonview?
if(!myPhotonView.isMine && sword.gameObject.collider.GetInstanceID () == true)
GUI.TextArea (new Rect(200,200,200,100), "Player hit by your sword!");
Debug.Log ("mySword " + collider.GetInstanceID());}
I might be missing something like "Public Transform sWord" in the declarations?
I'm trying to allow 1 specific player to see he hit another player with HIS sword so i can give him an on-hit score display GUI.
You know, "You hit player 'admin' X times!" debug almost shows it, but I can't send the GUI right :\ player should be aware, so his client can count and if he dealt majority of the damage, he should get the kill point.
any ideas?
I'm beginning to think I need to compare the player name from the photonview's knowlege?
So in psuedo... OnCollision(Collision sword){ send(sword, this.photonnetwork.playername); }
OnCollision(Collision player){
}
yeah... see, i'm confused. When the player hits another player, the sword should recognize what player it hit, so I can compare who got the most hits on the hit player. This way, last hits don't win fights.
I'm having a similar problem. When I shoot and kill a player (online) I want to display "player 1 killed player 2". I'm using Photon Networking. I need to somehow get a Photon player name from the hit collider and I have no idea how to.