Search Unity

Compatibility when appending extra fields to custom network message

Discussion in 'Connected Games' started by bartofzo, May 18, 2019.

  1. bartofzo


    Mar 16, 2017

    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.