Search Unity

Network View through client

Discussion in 'Multiplayer' started by G-o-D933, Oct 16, 2008.

  1. G-o-D933

    G-o-D933

    Joined:
    Oct 15, 2008
    Posts:
    185
    hello,

    so i still try to get a airhockey type game to work. physics are up and working now, so now i try to integrate network.

    what i have are two mallets, and a puck between them. one mallet is mousecontrolled on the server side, the other on the client side.

    to all 3 gameobjects i have added a netview reliable delta compressed on its rigid body.

    so if i now play on the server, everything seems fine, except, the opponents position is not updated.

    on the clients side, everything else but the own position is updated fine, own position is ofcourse mouse controlled. but as soon as the client hits the puck, the puck moves correct on the clients side, but the server still thinks its running as if the clients player stood on its starting position.

    what i would need to do, is to say, if the puck is on the servers table side, from now get servers mallet and the puck from the servers side, opponents mallet from client side, and the other way around if the puck is on the clients side of the table.

    is there any way to achieve this?
     
  2. G-o-D933

    G-o-D933

    Joined:
    Oct 15, 2008
    Posts:
    185
    Figured it out, Network.Instantiate is your friend. unity rocks, i'll get a license... if i only would have find it earlier, could have saved me quit some money :-/