#SyncVar Index out of range error on different hardware
12 messages · Page 1 of 1 (latest)
Mirror 66.x is like 3 years old, not supported. That said, you clearly have a SyncVar with a hook called UpdateHairColor that's trying to access a list entry by an index that is out of range of the elements in the list. Put a range check in there before attempting to get the entry, then figure out why the list isn't populated as you expect.
There is no list
error disagrees with you
ArgumentOutOfRangeException Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <31ddbb77ad66410c97138ec8b16c1d8f>:0
at BaseInventoryManager.UpdateHairColor
{
hairColor = newColor;
Hair.GetComponent<SpriteRenderer>().color = newColor;
Facial_Hair.GetComponent<SpriteRenderer>().color = newColor;
HairBack.GetComponent<SpriteRenderer>().color = newColor;
/*Debug.LogError("Eyebrows Int is " + eyebrowsInt);
if(eyebrowsInt == -1) return;
if(eyebrowsOptions.eyebrowsOptions[eyebrowsInt].eyebrowsColorable) Eyebrows.GetComponent<SpriteRenderer>().color = newColor;*/
}```
Yes I had one in there which I thought I addressed
but when I comment out the code it still shows up
eyebrowsOptions.eyebrowsOptions[eyebrowsInt]