Search Unity

Compatibility when appending extra fields to custom network message

Discussion in 'Multiplayer' started by bartofzo, May 18, 2019.

  1. bartofzo

    bartofzo

    Joined:
    Mar 16, 2017
    Posts:
    151
    Hi,

    So I'm in a situation where I'm adding some new stuff to my game and I have a class that is derived from MessageBase.

    Say I want to add a field named 'Skin' to the NewPlayer message. Will older versions of the client have a problem deserializing this message if that NewPlayer class doesn't have the Skin field yet?

    I have tested this with a server running a new version and a client with an old version and so far it seems to work, as long as the new field is declared after all of the other fields. But since the message is sent over the reliable channel and multiple messages may be combined (?) by UNET, I'm wondering if anyone knows if there can still be problems. Thanks.