Search Unity

Need help with serialization

Discussion in 'Multiplayer' started by Loppy, Jul 3, 2015.

  1. Loppy

    Loppy

    Joined:
    Jun 19, 2015
    Posts:
    11
    Im having the same problem for a week now and i dont really make any progress, its the following :
    I have an item class and i want to sync the items in the players inventory to other clients and the host.
    Do i need to write my own serialization?
    OnSerialize(NetworkWriter writer, bool forceAll) {
    this.int = .... ;
    }
    Or is there an easier way ? Like syncing to the server with a command and syncing the clients with client rpcs?
    Where would i put my serialization? In the inventory or the Item Script ?
    Im really out of ideas can somebody help here? :(
    thx in advance and sry or bad english :)