Cannot cast from source type to destination type.

Cannot cast from source type to destination type.
PhotonAnimatorView.DeserializeDataContinuously ()
(at Assets/Photon Unity Networking/Plugins/PhotonNetwork/Views/PhotonAnimatorView.cs:345)
PhotonAnimatorView.Update () (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/Views/PhotonAnimatorView.cs:140)

i am getting this error. No idea why.
Observed component in my photonview are phooton transform view and photon animator view

Comments

  • I got the same errors. I think too much info through the network is sent. I had a lot of animation variables and layers that were set to Continuous and another computer was connected to my Internet connection. When I changed most of those to Discrete, the errors disappeared. In other words, try to send less information via your network.
  • Hi @Tomza,

    I have tried to reproduce the issue, but my tests run fine. Is there any chance that you can share a repro case so that we can have a closer look at the issue?
  • Hi @Christian_Simon,

    I have no those errors now!
  • @Christian_Simon
    I'm currently also having the same issue. What has changed for me is that now I'm looping through a large list of children transforms (200+) inside OnPhotonSerializeView, attempting to sync their transforms. I get InvalidCastExceptions on the clients reading in changes and the client get's kicked out of the room.

    Any idea why this might be happening?
  • I think in most cases you don't have to update the transform component of a child object manually since it is moved relatively by it's parent object. There is one exception: if the child object moves on its own, you have to synchronize this movement, too. An example: there is Planet A which is moving through space and there is Planet B orbiting around Planet A. In this case you would have to synchronize Planet A (it's moving) and Planet B (it's also moving). If Planet B is not orbiting around Planet A, it would be enough to just synchronize the movement of Planet A (Planet B stays relative to Planet A's position).