Forum begins after the advertisement:
31 August 2023: We recently fixed a bug where our Patrons were not getting their titles displayed properly on their posts.
public void LoadIncubator()
{
if (incubatorStatus.Count == 0) { return; }
foreach (IncubatorBase Egg in incubatorStatus)
{
Incubator incubatorToLoad = incubators[Egg.incubatorID]; // here I get an out-of-index message
if(incubatorToLoad.timeToGrow<=0)
{
incubatorToLoad.EggPre.SetActive(false);
incubatorToLoad.timeToGrow = 0;
}
else
{
incubatorToLoad.EggPre.SetActive(true);
incubatorToLoad.timeToGrow = needToGrowDays;
}
}
}
I can’t solve this problem
but when i debug list count is 0
` Debug.Log(Egg.incubatorID);
Debug.Log(incubators.Count);
Incubator incubatorToLoad = incubators[Egg.incubatorID];
I have two objects in the list
But when I debug, it tells me the count is 0
i have tow object in list
When I debug the list count is 0
Debug.Log(incubators.Count);
Incubator incubatorToLoad = incubators[Egg.incubatorID];
I fixed the problem. I had a script mount error
Hi Potato, glad you managed to fix the issue!
Hi Potato, can you click on the ArgumentOutOfRangeException item on the Console and screenshot or copy the message there?
Advertisement below:
The Save Soil Movement
Poor farming practices and policies across the world have led to the degradation of agricultural soils in the world. This has led to the loss of nutritional value in our food over the years, and it will affect our food production capabilities in the coming decades.
Learn more about Save Soil →