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

Unity 5.3.1 networking (UNET) completely broken on iOS

Discussion in 'UNet' started by nxtboyIII, Dec 19, 2015.

  1. nxtboyIII

    nxtboyIII

    Joined:
    Jun 4, 2015
    Posts:
    280
    Hi,
    I recently updated to Unity 5.3.1 and ran my mobile game on my iPhone 6 plus. When I tried to create or join a match, the app crashed after half a second, before even loading the map. This doesn't happen in the editor, only on iOS.

    This completely ruins multiplayer for my game. In 5.3 we had the 15 syncvars error, and now in 5.3.1 it completely doesn't work on iOS.

    Please fix this ASAP, this completely ruins my game that I am trying to release...

    Thanks
     
  2. nxtboyIII

    nxtboyIII

    Joined:
    Jun 4, 2015
    Posts:
    280
    Case ID is 755722
     
  3. ashleyjlive

    ashleyjlive

    Joined:
    Oct 5, 2013
    Posts:
    11
    It's not just iOS, Windows UNET also now doesn't work as of 5.3 or 5.3.1. A large majority of things do not sync and functions do not fire and I am left a very unstable version of my game.
     
  4. eshan-mathur

    eshan-mathur

    Joined:
    Nov 22, 2011
    Posts:
    118
    I'm likely getting the exact same crash. Joining or creating a match through the matchmaker is completely broken.
     
  5. eshan-mathur

    eshan-mathur

    Joined:
    Nov 22, 2011
    Posts:
    118
    So based on the call stack I've found a workaround for now - before using the NetworkManager, set it's "runInBackground" property to false. The documentation states that it's not recommended on mobile devices, but that still shouldn't crash the app. Same is true for tvOS.

    If you're connecting to an OS X build acting as your second device, make sure you add a platform check - most likely the desktop app is running in the background because you're focused on Xcode or you have multiple of them running.

    Code (csharp):
    1.  
    2. if(Application.platform==RuntimePlatform.IPhonePlayer || Application.platform==RuntimePlatform.tvOS)
    3. {
    4. _networkManager.runInBackground=false;
    5. }
    6.  
     
    pacdan likes this.
  6. nxtboyIII

    nxtboyIII

    Joined:
    Jun 4, 2015
    Posts:
    280
    Thanks so much! Will try this and see if it works :)
     
    eshan-mathur likes this.
  7. pacdan

    pacdan

    Joined:
    Apr 23, 2013
    Posts:
    2
    Eshan- I was banging my head against the wall then found your solution and it worked. Networking is now functioning on my iPad. Thank you!!
     
    eshan-mathur likes this.
  8. kennethy

    kennethy

    Joined:
    Feb 22, 2016
    Posts:
    1
    Eshan came in clutch to save my final design project that is due in about 6 hours.
     
    eshan-mathur likes this.
  9. eshan-mathur

    eshan-mathur

    Joined:
    Nov 22, 2011
    Posts:
    118
    You're welcome! But AHH! This is still a problem? We're quite a few versions past 5.3.1!

    You're our only hope, @holliebuckets!

    (to be fair I haven't tested taking the fix out yet, I'm too afraid!)
     
  10. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    thanks for pinging me @eshan.mathur !! :D I've pinged the Multiplayer team to see what is up. I'm in Montreal for a summit this week but will still check back. :)
     
  11. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    Hi @eshan.mathur
    Sorry you're running into this issue. I know we have a bug listed above that was closed above, but could you submit your project in a bug with the listed workaround, and anything else you've run into on this issue? It will help us get to the bottom of it.