Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug Fish Networking: Automatic struct serialization using writer.Write() failing

Discussion in 'Multiplayer' started by Sebmod, Feb 28, 2024.

  1. Sebmod

    Sebmod

    Joined:
    Jan 15, 2015
    Posts:
    3
    Hi there!
    I'm currently refactoring my project and wanted to simplify the networking code.
    I have a few struct types that implement the same interface(IAction).
    The custom serializer for this interface simply calls the Write(Writer) method of the linked object, which in turns calls Writer.Write on the struct type itself.

    This should, according to the docs, allow the serializer to automatically generate the Writer.Write method.
    However, a runtime error pops up whenever the method is called.

    Relevant snippets have been attached, along with the error.
     

    Attached Files: