Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to change array size in Inspector variable in Unity?

Tags:

arrays

c#

unity3d

From what I have read this is how a vector "Size" is set

public Color[] teamAColors = new Color[4];

But when the code is run it looks like this enter image description here

It doesn't seem to matter what number I put for the [4], the Size always stays 6. I am not sure where the 6 number is even coming from as I have not set anything to that number.

I have even tried to

 public Color[] teamAColors;

And then let my array auto populate the Length, but that doesn't change the 6 either.

like image 232
Tim Cooley Avatar asked Jan 07 '23 17:01

Tim Cooley


1 Answers

Try hitting 'Reset' from the gear-button on the component. It will reset all filled entries, but it should remove the cached size.

I hope that helps!

like image 115
andeart Avatar answered Jan 19 '23 15:01

andeart