Forum begins after the advertisement:


[Part 11] Errors for Harvestable Crop, and ArgumentOutOfRangeExceptions

Home Forums Video Game Tutorial Series Creating a Farming RPG in Unity [Part 11] Errors for Harvestable Crop, and ArgumentOutOfRangeExceptions

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11599
    Jonathan Teo
    Moderator

    If you are getting some bugs with the harvesting of crops, with an ArgumentOutOfRangeException error appearing on the console, this topic may be helpful to you.

    An ArgumentOutOfRangeException happens when you try to access an array index that is outside of the range of the array. For example, if you have an array with 3 items, and you try to access the 6th item of the array with array[5], this error will occur.

    For this issue, it is likely that the Land index is not being assigned correctly.

    Ensure this.landID = landID; is in the LoadCrop function

    If you are getting the Collection was Modified error, this is a long-standing bug that was fixed in Part 17.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: