Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Unity Transport : Failed to initialize the Network Interface. Error Code -1.

Discussion in 'Multiplayer' started by Kartikaeya, May 4, 2021 at 3:16 PM.

  1. Kartikaeya


    Jan 3, 2021
    So I'm making a mobile VR game where the user will put on some google cardboard like device and would control the character movement through the keyboard on a laptop/computer which is on the same wifi network as the mobile.

    The way this is set up is that I have two different scenes, the controller scene(client) which runs on the computer and the scene containing the actual game(server) which runs on the mobile device in VR. Whenever there is a keyboard event on the computer the controller scene sends a network message to the main game scene on the mobile device, thus controlling the character movements.

    To send these network messages I've used the Unity transport package, and have used almost the exact script available here.
    The game runs fine when I build both the controller and the game (client & server) on pc i.e I'm able to control the character in the game scene from the controller scene. But it fails when either of the client or the server is built to the mobile device. I get these two errors on the mobile device :

    1. InvalidOperationException: Failed to initialize the NetworkInterface. Error Code: -1.
    2. Error on receive, errorCode = 16777219

    I am new to networking (and unity in general) so I'm sorry for taking your time if this turns out to be a noob mistake.
    Thanks a lot for your help in advance!