- Home /
Multiple particle meshes (shuriken) set from code
I'm emitting particles via code on specific points using this function and I want my particles to render as a mesh:
void Emit(Vector3 position, Vector3 velocity, float size, float lifetime, Color32 color);
(the version where you pass in a particle doesn't work for me for some reason - the docs say it's a legacy particle but autocomplete says it's a ParticleSystem.Particle).
I also want to choose each particle's mesh randomly from the list I pass in - this works if I use the emission tab to emit particles, but not using the code. I tried iterating over the particles and changing the randomseed value, but that doesn't affect the mesh. Is it possible to change the mesh from code? If not, I might go down a hacky shader route to switch meshes
Comment