- Home /
Question by
KuPAfoo · Jan 19, 2014 at 02:00 AM ·
colliderphotondeadgetinstanceid
[photon][RPC] GUI function to specific instanceID?
if(collision.gameObject.tag == "weapon")
{
Debug.Log ("a Player's sword: ("+collision.gameObject.GetInstanceID()+"hit my body " +gameObject.GetInstanceID());
this.myPhotonView.RPC("success", PhotonTargets.AllBuffered);
}
is on the player mesh
if(collision.gameObject.tag == "Player") {
Debug.Log (collider.GetInstanceID());
if(myPhotonView.collider.GetInstanceID()==collider.GetInstanceID())
{
Debug.Log ("mySword"+ gameObject.GetInstanceID()+" - hitEnemy" + collision.gameObject.GetInstanceID());
}
}
This is on the weapon's script. Both these match:
How do I send the sword that he hit specifically that enemy. I'm calculating % of hits done to player to display who killed who.
pun1-18.png
(5.4 kB)
Comment
Busy night on here tonight... I'm really trying to get something like "PlayerX killed playerY" on a gui button on player X's screen
$$anonymous$$aybe I should be sending a RPC to the remotes? and checking for a match to the collision.gameObject.GetInstanceID()?
I'm non-stop playing with this... any help would be nice!
Your answer
Follow this Question
Related Questions
how to move the player away when it's hit 3 Answers
Internal collisions 1 Answer
Lives/Death Script 1 Answer
Open a door by standing on a button 0 Answers
character controller only triggers colliders on its sides 1 Answer