Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Can anyone help point me in a right direction, please?

Discussion in 'Netcode for GameObjects' started by Volshar, Oct 13, 2022.

  1. Volshar

    Volshar

    Joined:
    Mar 14, 2021
    Posts:
    15
    Hi,
    My game was working fine but suddenly I started getting this error and I have no idea what might be the issue or where to look to fix this, I have no idea what part of my code or anything on my side that can be the problem. Can anyone help me, please?

    Code (CSharp):
    1.  
    2. InvalidCastException: Specified cast is not valid.
    3. Unity.Netcode.Components.NetworkAnimator.__rpc_handler_4140764492 (Unity.Netcode.NetworkBehaviour target, Unity.Netcode.FastBufferReader reader, Unity.Netcode.__RpcParams rpcParams) (at <07cbeaee338c4d1c80527cb1a4f9e280>:0)
    4. Unity.Netcode.RpcMessageHelpers.Handle (Unity.Netcode.NetworkContext& context, Unity.Netcode.RpcMetadata& metadata, Unity.Netcode.FastBufferReader& payload, Unity.Netcode.__RpcParams& rpcParams) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/Messages/RpcMessages.cs:77)
    5. Rethrow as Exception: Unhandled RPC exception!
    6. UnityEngine.Debug:LogException(Exception)
    7. Unity.Netcode.RpcMessageHelpers:Handle(NetworkContext&, RpcMetadata&, FastBufferReader&, __RpcParams&) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/Messages/RpcMessages.cs:81)
    8. Unity.Netcode.ServerRpcMessage:Handle(NetworkContext&) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/Messages/RpcMessages.cs:122)
    9. Unity.Netcode.MessagingSystem:ReceiveMessage(FastBufferReader, NetworkContext&, MessagingSystem) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/MessagingSystem.cs:457)
    10. Unity.Netcode.MessagingSystem:HandleMessage(MessageHeader&, FastBufferReader, UInt64, Single, Int32) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/MessagingSystem.cs:387)
    11. Unity.Netcode.MessagingSystem:processIncomingMessageQueue() (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Messaging/MessagingSystem.cs:407)
    12. Unity.Netcode.NetworkManager:OnNetworkEarlyUpdate() (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Core/NetworkManager.cs:1541)
    13. Unity.Netcode.NetworkManager:NetworkUpdate(NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Core/NetworkManager.cs:1473)
    14. Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage(NetworkUpdateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Core/NetworkUpdateLoop.cs:185)
    15. Unity.Netcode.<>c:<CreateLoopSystem>b__0_0() (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.2/Runtime/Core/NetworkUpdateLoop.cs:208)
    16.  
     
  2. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    676
  3. Volshar

    Volshar

    Joined:
    Mar 14, 2021
    Posts:
    15
    cerestorm likes this.