Search Unity

Custom Message string

Discussion in 'Netcode for GameObjects' started by unity_Wd9us_rR3t_Emg, Mar 14, 2022.

  1. unity_Wd9us_rR3t_Emg

    unity_Wd9us_rR3t_Emg

    Joined:
    Mar 5, 2019
    Posts:
    5
    Hello,

    I was wondering if there is a possibility to send a custom message that contains variable string, or if there is a smarter solution than me deconstructing the string into chars and sending them one by one?

    As I always get FastWriter Errors when trying to send a string and supposedly it is not suited to deserialize strings so I assume it is not supposed to be sent?

    Kind Regards

    EDIT:
    I figured you can set a fixed size for the FastWriter and then it works, but adjusting the size dynamically per string doesnt seem to work with string.Length * sizeof(char)
     
    Last edited: Mar 14, 2022