How do I reference the remote player?
Hi,
I have instantiated a character in through the network. This character has a component to handle life, animations and other things, but it is turned off on the remote version (only accessible on the local).
From the remote, when it gets hit, I am trying to send a message to this component.
How do I reference the remote version of the player?
My guess is:
int PhotonID = mActorCore.GetComponent().ownerId;
PhotonView mPhotonView = PhotonView.Find(PhotonID);
Could someone point me in the right direction?
I have instantiated a character in through the network. This character has a component to handle life, animations and other things, but it is turned off on the remote version (only accessible on the local).
From the remote, when it gets hit, I am trying to send a message to this component.
How do I reference the remote version of the player?
My guess is:
int PhotonID = mActorCore.GetComponent().ownerId;
PhotonView mPhotonView = PhotonView.Find(PhotonID);
Could someone point me in the right direction?
0
Best Answer
-
Hi @rubble,
I don't get why you have disabled the component on the remote clients? I'm pretty sure it is easier to surround the certain parts of the code with aPhotonView.isMine
condition in order to process this code only on the owner of the object.5
Answers
-
Hi @rubble,
I don't get why you have disabled the component on the remote clients? I'm pretty sure it is easier to surround the certain parts of the code with aPhotonView.isMine
condition in order to process this code only on the owner of the object.5