Difference between Static, Dynamic, and Built-In Arrays

the story so far …

I should do some research before asking this question, but I was unaware of Built-In Arrays, only assuming there were 2 types of array : Static and Dynamic. I put the point out there that research I did revealed static arrays were slightly more efficient than List. Now built-in has thrown me i.e. are they only for ints/floats? or do built-in arrays exist for transform, vector3, etc? (It’s just hard sometimes when one doesn’t know of the existence of these functions/commands). I was kindly given a link by Fattie to : Javascript array, use with a struct ? - Questions & Answers - Unity Discussions

This came from a discussion here : Javascript array, use with a struct ? - Questions & Answers - Unity Discussions

Could anyone possibly elaborate on Built-In?

Elaborate how?

Built-in arrays are like this:

var foo : GameObject[];

Is that what you mean by static arrays?

yes, and also like with my meshes i.e.

verts = Vector3[24]; 
uv = Vector2[24]; 
tris = int[12];

These are what I assumed to be Static arrays. Then the dynamic (of which I don’t use so this is probably wrong) myItems = Array(); (parenthesis rather than square brackets).

I think your question answers itself. :slight_smile: The Unity docs refer to arrays like GameObject as built-in arrays, which is useful since “static array” could potentially be confused with the static keyword. There are a number of collections that could be referred to as dynamically-sized arrays, such as the JS Array class, ArrayList, and generic List.