I get this error when someone joins Rethrow as AggregateException: Caught 1 exception(s) in methods

Options

Pls help I dont know why it happens and when i click on the error it points to the photonHandler

Best Answer

  • Tobias
    Tobias admin
    Answer ✓
    Options

    For some reason, the PhotonAnimatorView seems to be reading more than it sends. There is no known issue which causes it to do that in all cases, so you have to dig a bit into your project and debug what it's sending versus what it receives.

    It is quite complex to fix such issues when there wasn't a single change that caused it. You may want to check the setup of your prefabs and characters or create a new, simpler one with the PAV on it. Something simpler that works, then add stuff one by one and check what causes it.

    Which version of PUN do you use? Which Unity version? Are there other errors?

Answers

  • marwans200
    Options

    This happens once and the other one happens almost every frame


    IndexOutOfRangeException: Index was outside the bounds of the array.

    Photon.Pun.PhotonStream.PeekNext () (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:595)

    Photon.Pun.PhotonAnimatorView.OnPhotonSerializeView (Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/Views/PhotonAnimatorView.cs:559)

    Photon.Pun.PhotonView.DeserializeComponent (UnityEngine.Component component, Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:544)

    Photon.Pun.PhotonView.DeserializeView (Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:534)

    Photon.Pun.PhotonNetwork.OnSerializeRead (System.Object[] data, Photon.Realtime.Player sender, System.Int32 networkTime, System.Int16 correctPrefix) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1862)

    Photon.Pun.PhotonNetwork.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:2233)

    Photon.Realtime.LoadBalancingClient.OnEvent (ExitGames.Client.Photon.EventData photonEvent) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3364)

    ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PeerBase.cs:899)

    ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/EnetPeer.cs:583)

    ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at C:/Dev/photon-sdk-dotnet/PhotonDotNet/PhotonPeer.cs:1771)

    Photon.Pun.PhotonHandler.Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:226)

    Rethrow as AggregateException: Caught 2 exception(s) in methods called by DispatchIncomingCommands(). Rethrowing first only (see above). (Index was outside the bounds of the array.)

    Photon.Pun.PhotonHandler.Dispatch () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:242)

    Photon.Pun.PhotonHandler.FixedUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:145)

  • Tobias
    Tobias admin
    Answer ✓
    Options

    For some reason, the PhotonAnimatorView seems to be reading more than it sends. There is no known issue which causes it to do that in all cases, so you have to dig a bit into your project and debug what it's sending versus what it receives.

    It is quite complex to fix such issues when there wasn't a single change that caused it. You may want to check the setup of your prefabs and characters or create a new, simpler one with the PAV on it. Something simpler that works, then add stuff one by one and check what causes it.

    Which version of PUN do you use? Which Unity version? Are there other errors?

  • marwans200
    Options

    I use unity 2021.3.16f and there are no other errors. I'm also using pun 2.41. I am now doing what you told...

    I also have two photon animator view component on the player prefab. will that be the problem?

  • marwans200
    Options

    Ok I somehow seems to have fixed it by removing one of the PAV. Thank you Tobias for pointing me to it