#SyncVar Index out of range error on different hardware

12 messages · Page 1 of 1 (latest)

sacred crow
#

Hi, I get this error on one test PC but not another. All other conditions are identical. I am having a hard time understanding the issue, this is tested in a dev build not editor. Version 66.0.9

#

This is showing on the host

soft bobcat
#

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.

sacred crow
#

There is no list

soft bobcat
#

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
sacred crow
#
    {
        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

soft bobcat
#

eyebrowsOptions.eyebrowsOptions[eyebrowsInt]

sacred crow
#

which made me think it is something else

#

Thanks for quickly getting back to me btw

#

Ok so I think what is happening then is that steam is somehow redirecting the build to open the version in the steam library not the new version I downloaded and so the fix wasnt in the build...