Currently I’m initializing an array of Vector3 in C# like so :
Vector3[] positionArray = new Vector3[4];
positionArray[0] = new Vector3(0.0f,0.0f,0.0f);
positionArray[1] = new Vector3(0.1f,0.1f,0.1f);
positionArray[2] = new Vector3(0.2f,0.3f,0.4f);
positionArray[3] = new Vector3(0.5f,0.5f,0.5f);
I’ve tried initializing the array using shorter methods, but all have failed. Heres an example of one that I tried :
Vector3[] positionArray = new Vector3((0f,0f,0f),(1f,1f,1f));
And here is the error that Unity reports back :
A field or property
UnityEngine.Vector3' cannot be initialized with a collection object initializer because type
UnityEngine.Vector3’ does not implement `System.Collections.IEnumerable’ interface