Search Unity

NetworkView client to server communication?

Discussion in 'Multiplayer' started by jshmrsn, Jan 31, 2010.

  1. jshmrsn

    jshmrsn

    Joined:
    Jan 31, 2010
    Posts:
    8
    Hi, sorry if this is an obvious question, but I'm just starting out. I'm reading the networking tutorials and so far all examples show Server->Client using NetworkViews serialization while Client->Server (user input) is handled with RPCs.

    I imagine this is fine in mot cases, but I'd really like to understand how to use NetworkView serialization for Client->Server communication.

    From reading docs, it seems like the client needs to "own" the NetworkView instead of the server. I'm not sure how to use set this up in Unity... I'm not sure how it's determined that the server instance is the owner in the first place.

    Any advice/guidance would be greatly appreciated, thanks!

    -Josh
     
  2. jshmrsn

    jshmrsn

    Joined:
    Jan 31, 2010
    Posts:
    8
    Figured it out :)
    (mostly)

    The client needs to be the owner of the object with the NetworkView component using Network.Instantiate()