- Home /
Question by
DavidDebnar · Dec 28, 2012 at 10:57 AM ·
javascriptvector3compiler error
[JS] Vector3[] compiler error
Hey guys, I ran into a strange error today. My code is:
private var foo : Vector3[] = { Vector3(0,0,0) };
and the error I get is:
BCE0044: expecting :, found ','.
My question is: Is my brain being really stupid and I'm overlooking something obvious, or does JS have a different syntax for built-in array declaration?
Thanks,
David
Comment
By the way, why do you want an array since you only place one there?
private var foo = new Vector3(0f,0f,0f);
would do the same.
It's just an example...$$anonymous$$y code has a greater number of vectors, but I wanted this Question to be more readable.
Best Answer
Answer by DavidDebnar · Dec 28, 2012 at 03:19 PM
The answer is not to use { } but [] instead.
var foo : Vector3[] = [ Vector3(0,0,0), Vector3(0,0,0) ];
does work.
---David