I have a question, I got them to spawn at random.

How do I tell it not to spawn, for instance I have chanceOfPlatformA = .5f; I can get it to spawn at <=50% but however I have B set to >=.7(30%) how will I tell one not to spawn if one was already selected and spawned? is there a way I can use two if statements for one Variable and simply to tell one not to spawn if the values is less than or equal to and to spawn if the value is greater than or equal to?

function OnTriggerEnter(other : Collider){
	if(Random.value <= chanceOfPlatformA) {
		Instantiate(platformA, platformSpawn.transform.position, Quaternion.identity);
	}
			

	else if(Random.value >= chanceOfPlatformB) {
		Instantiate(platformB, platformSpawn.transform.position, Quaternion.identity);
	}
	
	else if(Random.value >= chanceOfPlatformC) {
		Instantiate(platformC, platformSpawn.transform.position, Quaternion.identity);
	}
}

try to plug this in:

make a variable that is set when you do whatever you have to do to pick the spawn location. say its a button:

public float randomizer;


if (GUI.Button (new Rect (10,10,150,20), "TEST BTN - PRESS ME")) {
randomizer == Random.Range(0,10);
}


function OnTriggerEnter(other : Collider){ if(randomizer <= chanceOfPlatformA) { Instantiate(platformA, platformSpawn.transform.position, Quaternion.identity); }

etc, etc, do your else statements.

Your looking for nested ifs, like so

if(!gameObjectHasAlreadySpawned){
    if(Random.value <= chanceOfPlatformA) {
        // And the rest
    }
}

Or use the && operator

if (!gameObjectHasAlreadySpawned && Random.value <= chanceOfPlatformA){
    // Will only execute if both conditions are satisfied
}