how do i use photonPlayer to control specific player in PhotonView.RPS?
something like this
photonView.RPC(“Fight”,PhotonPlayer(playername));
thanks
how do i use photonPlayer to control specific player in PhotonView.RPS?
something like this
photonView.RPC(“Fight”,PhotonPlayer(playername));
thanks
If you mean how to get the player to send out a function to everyone of their instances on the network, it would be
photonView.RPC("FunctionToCall", PhotonTargets.All);
Now if your talking about player movement over network, doing it with RPCs is not the best way to do it.
You would instead have a photonview that observes a script with this in it
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
if (stream.isWriting) {
//Our player. Sending position to server
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
} else {
//Someone elses player. Updating their position
realPosition = (Vector3)stream.ReceiveNext();
realRotation = (Quaternion)stream.ReceiveNext();
}
}
thanks buddy
but i want to control a specific player only inside the room.
any idea?