Hey,
i’m trying to use one ParticleSystem to emit particles with different styles. All praticles are generates via code and everything works as expected except of the tiling. All particles always have the same Tile which is the last value of the line anim.rowIndex = i % noOfTiles;
The code runs once on Start()
public void Generate(int noOfObjects, int noOfTiles)
{
List<Vector3> spawnLocations = FancyRandomFunction();
ParticleSystem.Particle[] particles = new ParticleSystem.Particle[noOfObjects];
ParticleSystem.TextureSheetAnimationModule anim = ps.textureSheetAnimation;
for (int i = 0; i < noOfObjects; i++)
{
particles *= new ParticleSystem.Particle();*
particles_.position = spawnLocations*;_
_particles.remainingLifetime = 100f;_
_particles.startSize = 1f;_
_particles.startLifetime = 100f;_
_particles.startColor = Color.white;*_
* anim.rowIndex = i % noOfTiles; // <— alternate RowIndex*
}
ps.SetParticles(particles, noOfObjects);
}
Is there any way to force different tiles for each particle from code?