Search Unity

NetworkWriter Custom MsgType?

Discussion in 'Multiplayer' started by M0rph3v5, Nov 13, 2015.

  1. M0rph3v5

    M0rph3v5

    Joined:
    Aug 15, 2012
    Posts:
    24
    Hey,

    Just started with implementing a custom NetworkWriter, it starts with passing the message type in the .StartMessage() function. How do you implement a custom msgtype?

    Since if you use whatever number you want that's not used internally it just throws errors that it doesn't know what to do with it.

    Cheers,

    Benjamin
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
  3. M0rph3v5

    M0rph3v5

    Joined:
    Aug 15, 2012
    Posts:
    24
    Totally missed that, I only found some forum posts with example code missing that.

    Also didn't know they were called Network Messages, makes sense now ;)

    What's the difference between using network messages and just sending a [Command] which sets the dirty bits? (Which triggers the serializer)

    Thanks!