Is it possible to select one of multiple random materials for use in a single particle effect? I’m using the new particle system and want to have it look like different types of debris explode from the same point, preferably without making a bunch of different particle effects sitting at the same point in space. Cheers!
you would need to generate a random number and then have that number correspond to a certain material.
var particleNum = Random.Range(1,4); //Generates a number between 1 and 3
var particleMat1 : Material;
var particleMat2 : Material;
var particleMat3 : Material;
if (particleNum == 1) {
//set the particle material to particleMat1
ParticleSystemGameObject.Renderer.Material = particleMat1; //Not sure if that's how
// you set the material for the particles but that's how you would for objects.
}
if (particleNum == 2) {
//set the particle material to particleMat2
ParticleSystemGameObject.Renderer.Material = particleMat2;
}
That code won’t work exactly if you copy and paste it but I hope you get the general idea