Hi there, I have an Instantiate line of code which picks a random object in the array between 0-8. 4 of these objects are rotated 180 degrees on the Y axis. For some reason when one of these are instantiated, they are set back to 0. How can I stop this?

GameObject clone = Instantiate (corridors[Random.Range(0,8)], new Vector3 (lastSpawned.transform.position.x + 8.5f, 0, 0), Quaternion.identity) as GameObject;

Not sure what I am doing wrong here?

You’re using Quaternion.Identity, which is basically equal to no rotation.

If you want it to be rotated like the gameObject where the script is attached use:
this.transform.rotation.

Or if you want to keep the rotation as is, use corridors[Random.Range(0,8)].transform.rotation.

Quaternion.identity correlates to 0 rotation. You will want to grab the rotation of the object and pass that in the Quaternion() argument parameters.

Check here for more info on Quaternions: Unity - Scripting API: Quaternion