Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Networking Networking sample projects

Discussion in '5.1 Beta' started by seanr, May 11, 2015.

  1. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    Attached are some sample projects that use the new networking system. Warning, these contain programmer art and are not pretty at all.

    2dshooter - is a 2d shooter game, use arrow keys and space bar, start with the "start" scene.

    tanks - is a 2d tank example, use mouse and arrow keys, start with the "title" scene.

    Invaders - is a 2d arcade game, use arrow keys and space bar, start with the "StartMenu" scene.

    NetworkStarter - is simple 3d with boxes, it uses the multiplayer lobby and does scene changes, start with the "lobbyNewGUI" scene.

    move - is a simple 3d client movement test, use arrow keys and space bar, start with the "ballz" scene.
     

    Attached Files:

  2. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Massive help, thank you Sean.
    Looking forward to the dedicated server stuff next ;)
     
    chiapet1021 likes this.
  3. dariuszpietrala

    dariuszpietrala

    Joined:
    Oct 5, 2012
    Posts:
    148
    I tried the tanks project. It works on PC (editor+standalone). But on a Android device I get this:

    Failed to read the ID for the match maker, please set the Cloud Project ID string in the Player Settings


    The ID is set. I added a new project, copied the Project GUID and pasted it in Player Settings. Am I doing something wrong?

    And when I change the Cloud Project ID in Player Settings it still works on PC...
     
    Last edited: May 26, 2015
    macagu likes this.
  4. robrjames

    robrjames

    Joined:
    Dec 22, 2009
    Posts:
    4
    I can get these to work in LAN mode (Unity Editor, Stand alone build, and Web Build) -- Invaders demo

    However I'm trying to get the webGL build to communicate. And that is failing to connect. I've tried it as host or joining.

    I get (if I use "localhost")
    "failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED". I tried localhost as well as my local IP address.

    If I use my local ip address the webgl build crashes (both on Chrome and FF)

    Are these demos supposed to work with webGL? I'm using 5.1.0f1

    And Host / Join internet game doesn't seem to do anything at all (on any build). How is that supposed to work?

    Thanks for your help.
     
    macagu likes this.
  5. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143
    BTW - NetworkStarter - the colour of the players stays black, regardless of what's chosen (5.1.0f2)

    edit: if anyone else wants to see this working, take a look inside: GuiLobbyManager.cs -OnLobbyServerSceneLoadedForPlayer
     
    Last edited: Jun 7, 2015