C# Array with random.range help?

Hey guys I’m trying to get this random.range stuff to work where the scene is a car race, and you got to collide into a cube and one of two game objects appears. I want to make it so that both objects appear randomly when you collide with the cube. Like hit one cube it will be a yellow one hit the next one and it will be red, then hit the third one and it might be red again?

using UnityEngine;
using System.Collections;

public class PowerUp : MonoBehaviour
{

public GameObject[] powerupObject;

void OnTriggerEnter(Collider collision)
{
	GameObject newPowerup;
	newPowerup = Instantiate(powerupObject [0], this.transform.position, Quaternion.identity)as GameObject;
	Vector3 temp = new Vector3(Random.Range(-10.0F, 10.0F), 0, Random.Range(-10.0F, 10.0F));
	temp.y = 5;
	temp.z = this.transform.position.z + 10;
	newPowerup.transform.position = temp;
	Destroy (this.gameObject);
	

}

}

Random.Range() takes 2 INTEGERS not FLOATS. Try that and see if it helps…

Below code should work properly.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public GameObject prefab;
    void Start() {
        Vector3 position = new Vector3(Random.Range(-10.0F, 10.0F), 0, Random.Range(-10.0F, 10.0F));
        Instantiate(prefab, position, Quaternion.identity) as GameObject;
    }
}

and for your kind knowledge random.range accepts both integer and floats.