Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

A few beginner questions about the networking changes in 2018.2 and Raknet

Discussion in 'Connected Games' started by SuperDanCraft_, Jul 13, 2018.

  1. SuperDanCraft_

    SuperDanCraft_

    Joined:
    Aug 12, 2015
    Posts:
    2
    So I've made a super-basic networking game to test the waters with Unity 2018.1
    Now I've updated the project to Unity 2018.2, and i get an error message that NetworkDisconnect and NetworkPlayer are obsolete.
    The 2018.2 blog post mentioned that something called Raknet was removed and that I have to use unity's new networking feature. Anyway this led me to wonder:
    • What exactly was Raknet? How was it integrated into Unity? How is it related to UNET and the HLAPI?
    • Why can't I use NetworkDisconnect and NetworkPlayer now?
    • What's this mysterious new networking feature that replaces Raknet? How can I use it?
    • How am I supposed to call OnDisconnectFromServer() and OnPlayerConnect() now? Am I supposed to? If not, what's the alternative?
    Any tiny bit of information helps, so thank you in advance!
     
  2. faldor20

    faldor20

    Joined:
    Feb 9, 2017
    Posts:
    3
    looking for the exact some thing. networking.peertype doesn't work and i cant figure out how to replace it
     
  3. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    939
    I could be mistaken, but it sounds like you're both using the old pre-UNET networking components.

    These have been removed from Unity 2018.2, so you'll either have to stick with an older version of Unity or change to a different networking system.
     
    SuperDanCraft_ likes this.
  4. SuperDanCraft_

    SuperDanCraft_

    Joined:
    Aug 12, 2015
    Posts:
    2
    I'm not sure where the line between pre-UNET networking and post-UNET networking is, but I do know that many of my gameobjects have Network Identity components and that I don't use any NetworkViews, which I understand has something to do with the old networking system.

    The only things which are broken in my project right now are the OnDisconnectedFromServer(NetwrokDisconnect) and OnPlayerConnect(NetworkPlayer) messages, because NetworkDisconnect and NetworkPlayer have been removed.
     
  5. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    939
    Being a Photon PUN user I'm not completely familiar with Unity's networking offerings, however I'm fairly certain the old Raknet based system isn't interchangeable with the newer UNET HLAPI.

    For what it's worth, my advice would be to steer clear of Unity's networking for the time being, unless you like lots of frustration.