Search Unity

If my project keeps getting an error will I be able to build it?

Discussion in 'Editor & General Support' started by b1rso, Aug 9, 2018.

  1. b1rso

    b1rso

    Joined:
    Jul 7, 2018
    Posts:
    19
    There are some moments on my game that I get the error "Argument out of range", but it's for a few seconds and the game keeps running perfectly. After some seconds it stops getting the error. If I build my game will it have any problem on its execution?
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    You can build it, but any run time error might cause your build to crash. Even if it doesn't crash, it could cause unexpected things to happen. You should always try to find and fix these.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It will not resolve the error if that is what you're getting at. Argument out of range is typically from using an array or list index number that doesn't exist. They are usually easy to resolve too. Either find where in your game logic you think an index should exist but actually does not, or use the Length or Count property to check if the index is there or not before trying to use it. The error when hit in the editor should point to the exact line of code.