Hi, I have a sceniario where there are a lot of RPC calls being made on a game object, any one of which could potentially result in that object calling PhotonNetwork.Destroy on itself. Predictably, this occcasionally results in RPC-method-not-found-on-object errors, because a bunch of the RPCs come in, and before the last RPC is completed, the target has been destroyed and a new object of a different kind has already taken the photonview ID number.
This seems like a fairly mundane scenario to me, so I’m guessing there are some reliable ways to handle it. Any tips?
RPCs target a specific PhotonView. This basically makes up the networked object.
When this is destroyed … you should not be able to call RPCs on it anymore. If this happens anyways, this obviously leads to undefined behavior or at least … logs.
You can decide this is what you want, then … get rid of the logs. If it’s working for you, no problem.
You could also use RaiseEvent instead and send the events to manage your objects in the specific way your game needs it. PUN uses RaiseEvent for RPCs, too.