Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Networking pointers

Discussion in 'Multiplayer' started by WarpedAxiom, Jan 13, 2008.

  1. WarpedAxiom

    WarpedAxiom

    Joined:
    Oct 27, 2006
    Posts:
    245
    It was not that long ago I came before you with troubles of a very rudimentary nature. And I got the help I needed, and I progressed. It is my misfortune that I must always strive for the things out of my reach, but it is also a gift as it helps me to learn.
    Anyway, now my eyes turn to Networking, a long harbored dream. I have managed to connect two computers together with no small help from the Network Assets Project, but a number of problems arouse.
    1, It seems BOTH computers control BOTH instantiated prefabs.
    2, Things like bullets and effects only show up on the computer firing, as if they exist in two different universes.

    Any help gladly received.
     
  2. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    277
    When you network instantiate something which is controlled by the local user you need either disable the controls on the remote instantiation or have them disabled by default and enable on the local instantiation. Have a look at the networking example project, the Third Person scene, and check how this is done there (see ThirdPersonNetworkInit.js).

    It sounds like you are not firing these events (functions) as RPCs. If you want some event, like a gunshot effect, to occur on all clients, you need to execute it as an RPC. You can either do a local call and then the RPC call with RPCMode.Others or if the calls are identical just do RPCMode.All and skip the local call.
     
  3. WarpedAxiom

    WarpedAxiom

    Joined:
    Oct 27, 2006
    Posts:
    245
    Thank you, that was very helpful. I'm getting around by dissecting the scripts and doing trials... but I can't get any sound. Not that I could before. The sound effects are only on the computer that instantiated the bullet.