Hi all,
I googled this error message: “Received RPC xx for viewID 147 but this PhotonView does not exist…” and I understand the cause in the circumstances of other questions.
In my case though, I just have one scene in the game that is loaded on startup. It contains around 100 objects with PhotonViews, all of them have different viewIDs. The player can walk around in the scene and click on objects to pick them up, therefore I use an RPC to notify everyone that the object is “in use” and can’t be picked up by others and I request ownership so that the object’s position gets sent from the player who picked it up.
So I am starting the game in the editor, all objects with PhotonViews present, I connect to the room, my player spawns and I walk around a bit. I can pick up several objects but on certain objects I got the error mentioned above. The PhotonView is set up all the same, I can see the viewID in the editor, everything should work. The RPC is not sent in Start() or Awake() etc. and I can not determine any patern in the id (e.g. viewId 86 is working but 87 is not, but 88 is fine).
A bit of example code from the object the player grabs that contains the PhotonView:
public void SetInUse(bool isInUse)
{
if (PhotonNetwork.IsConnected)
{
GetComponent<PhotonView>().RPC("SetNetInUse", RpcTarget.AllBuffered, isInUse);
if(isInUse) GetComponent<PhotonView>().RequestOwnership();
}
else
{
SetNetInUse(isInUse);
}
}
[PunRPC]
public void SetNetInUse(bool isInUse)
{
this.isInUse = isInUse;
}
Thanks for any advice!