Instantiate a GameObject randomly between 2 rotation values

Hello

I’m trying to spawn GameObjects (walls) on their original rotation (0) or randomly turned 180 too.
this is what I tried:

{
Vector3 startPos = transform.position; // get the current spawner position
Quaternion spawnRotation[0] = Quaternion.identity; // this quaternion corresponds to no rotation
Quaternion spawnRotation[1] = Quaternion.Euler(0, 0, 180); // 180 turned value
Instantiate (wall, startPos, spawnRotation[Random.Range(0,2)]); // what I thought would work to Instantiate my wall at startPos with a rotation random between spawnRotation 0 and 1    				
}

But I have these Red Alerts :slight_smile:

error CS0650: Syntax error, bad array, declarator. To declare a managed array the rank specifier precedes the variable’s identifier. To declare a fixed size buffer field, use the fixed keyword before the field type
and
error CS1525: Unexpected symbol =', expecting )‘, ,', or ;’

Starting to learn C#, Can someone tell me what i’m doing technically wrong here please ?
Thx

Solutions available here :
http://forum.unity3d.com/threads/solved-instantiate-a-gameobject-randomly-between-2-rotation-values.390282/

Thx.