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);
}
}