InvalidCastException: Specified cast is not valid

Options
InvalidCastException: Specified cast is not valid.
Photon.Pun.PhotonStream.Serialize (System.Boolean& myBool) (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:779)

Looks like bug. Sometimes. Sometimes not.
PUN v 2.20.1 Photon lib 4.1.4.4
Unity v 2018.2.8f1

Comments

  • emotitron
    Options
    Do you happen to have the code at line 779? That file has been touched a lot recently so I am not sure what that line would have been for you.
  • emotitron
    Options
    It looks like the bool read based on the error.
    myBool = (bool) this.readData[this.currentItem];
    

    That being the case it suggests a read/write mismatch. Is an RPC or an Observable creating this serialization?
  • Ratmir
    Options
    Sorry it was my falt with game logic.