detect the real player of the clone
Comments
-
Yes, it's relatively simple.
Each player has a PhotonView, and you can check the PhotonView.isMine attribute to find out if yours is local. If you want to tell the other player, you'd do an RPC to their specific PhotonPlayer object. So, for example:
private PhotonView pView;
void Awake()
{
pView = GetComponent<PhotonView>();
}
void OnCollisionEnter (Collision c)
{
if (c.gameObject.Tag == "Player")
pView.RPC("Hit", c.gameObject.GetComponent<PhotonView>().owner, /* any variables sent along here in an array */);
}
[RPC]
void Hit(/* variables */)
{
Debug.Log("Oh no, we've been struck!");
}
I'd read up on the Photon Cloud docs, they have a good section on RPC calls and it'll help you understand it better. Any other specific questions, lemme know!0 -
Thanks for answerring that. The key is indeed to check the PhotonPlayer via a PhotonView.0