Illegal view ID method with tutorial punbasics

Options
Hello, I have done the demo punbasics for PUN2 and all I wanted to do is adding a button in the room scenes, when I click it send a rcp call. So I've defined my onclick in the player manager and when I run it, I get the illegal view ID method. I don't get it cause it's in the player manager where rcp call in the update are fine. Could you explain?

Comments

  • Malace
    Options
    What is it your rpc is attempting to do? This error implies you are either trying to access a network view for a object without a network view. Or that one of your clients the rpc tries to update does not have that object by that id to update.

    I'd gladly take a look if you would like to add some code and debug info. At least the rpc and onclick segments should be a good start.
  • antigode
    Options
    Hi thank you a lot for trying to help me. I fixed the issue and i'm gonna tell you how i made it as i've seen this issue many times on the internet. This has nothing to do with the Photon thing, it was just a prefab issue. I was calling my onclick function from a prefab, so it was obvious that it didn't have its photonView.
    I turned: "this.playerPrefab.myOnClick()" to "PlayerManager.LocalPlayerInstance.myOnClick()" in the Game Manager Script. It took me 2 days to figure it out...