Hi there,
@ in a network room, in my local set up, I have two PhotonView objects. 1) the local player, 2) the opponent.
My issue is this. At local player or opponent win, a message is sent across the network that as such. Since all PhotonView components are called at this time, on a local level I differentiate between the two via thisManager. If thisMananger is null, I know that it would only be null on the oppoenent, since on the network level it has no need for a thisManager, it is mererly a reflection.
But I digress, this works except for the fact that the local PhotonView, local player, is not notified and I am at a loss as to why.
[PunRPC]
public void roundOver(){
///if this has a manager, then it is the local player, else, the opponents network refleection
if(mananger == null){
///this is the opponents reflection.. do nothing....
}
else{
///this is the local player..... as such, inform the local manager to proceed.
mananger.roundOver();
}
}
My issue is that the opponents, reflection is being called, but not the local player, despite the local player having a photonview and a manager.
Any ideas???
If the RPC is not being called locally on the client that does photonView.RPC(…), maybe you’re not using PhotonTargets.All in that call?
Not sure if I follow your explanation completely.
Irrelevant now… See below.
OK.
So here is the issue @tobiass , hopefully this makes sense. My whole circuit is working except when I terminate the round and a condition must be met, if(manager != null). The case of a null manager means the unit is a representation of an opponent, it’s “reflection” controlled remotely. It is not the local player.
The issue is, manager != null, then the function does not work as it should.
I have a method which I call across the network at termination of the round (ex. player x won level). This works and is called, however, it seems again, that the local player is not notified.
at level won by player x…
playerPhotonView.RPC("levelWon", PhotonTargets.All, new object[] {playerPhotonID};
… on each player…
[PunRPC]
void levelWon(int playerID){
if(playerID != thisPlayerID){
//HOLE LOST
manager.holeLost();
}
else{
//HOLE WON
mamanger.holeWon();
}
}
… the above works with one exception… any player without a mananger(manager == null, in other words, a clone, mirrored reflection of an oppoenent) will fire an error. So, as a quick fix…
if(manager)
manager.holeWon();
HOWEVER now, this instance does not fire.
???