Could not find RPC with index: 5

Options
When adding a new RPC function, I've encountered errors like this. I see in Photon 2, the settings no longer shows any list of RPCs which seems to be different that the previous version. So what's the procedure for adding new RPC methods? Do I need to Clear RPCs, and then Refresh RPCs each time? I just tried Refresh RPCs and it didn't help, but it seems like this should have helped.

Comments

  • Hi @BuilderWorldVR,

    can you confirm, that the function is marked with the [PunRPC] attribute?

    To check the RPC list in the Editor, you can select the PhotonServerSettings file and turn the inspector into debug mode. Therefore you will find a litte dropdown menu in the upper right corner of the inspector (next to the lock). By default 'Normal' is selected. You can set this to 'Debug' to get further information, for example the RPC list. Check if your function appears in the list.
  • I've found that with the caching it's a bit quirky in that refreshing RPC's or (clearing + refreshing; no difference) will only find newly annotated [PunRPC] methods will be added to the list; while obsolete/de-annotated method names will remain in the asset but not shown in the listing. I check both the debug view of the asset in the inspector and the git/vcs difference report. The only way I've round to get a truly pristine mapping of ALL AND ONLY [PunRPC] annotated methods is to clear the RPC's then delete my Library, obj, and VS/Mono .proj and .sln files restart Unity. I'll do this at least one more time for my project when I remove the Demo projects from Unity.