Search Unity

host id out of bound id {-1}

Discussion in 'Multiplayer' started by cephalo2, Mar 16, 2018.

  1. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    263
    I was having an error today, and while searching the internet for an answer I did not find an adequate explanation, but in my case I found the problem and I want to report it for future unity people.

    The complete error was:

    host id out of bound id {-1} max id should be greater than 0 and less than 1

    The reason I got this error was that I called StopHost() within a message handler callback. I wanted to know from the client whether it was ok to quit the game, and tried to StopHost during that message handler.

    The solution was to call StopHost in the subsequent frame.