Search Unity

Problem using UNET

Discussion in 'UNet' started by Kelprim, Oct 12, 2019.

  1. Kelprim

    Kelprim

    Joined:
    Jun 20, 2019
    Posts:
    2
    Hi guys,

    Currently I am programming a Bomberman for school, and I followed this guide for that:

    https://gamedevacademy.org/how-to-create-a-multiplayer-bomberman-game-in-unity-part-3/

    I have almost finished it, but I can't find the way to join a match through buttons. Every time I try to do it, this message appears:

    'ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'

    And it points to this line of code:

    'networkManager.matchMaker.JoinMatch(matches [0].networkId, string.Empty, string.Empty, string.Empty, 0, 0, OnMatchJoined);'

    What can I do?

    Thanks in advance!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Check the length or count of "matches" just before that line. I'm expecting you'll find that the result is 0.
     
  3. Kelprim

    Kelprim

    Joined:
    Jun 20, 2019
    Posts:
    2
    Indeed, the length is 0. What should I do? The match is created, but it looks as it is not able to find it.