To use sprite sheets for particles animation, follow these steps:
- Import the sprite sheet texture into Unity. Its size should be a power of 2. The animation should be rendered from left to right and from top to bottom in equal tiles (128 × 128, 256 × 256, or similar).
- Set it as a normal Texture (not a Sprite) and check the Alpha Is Transparency option.
- Create a new Material and name it Explosion.
- Set the Shader to Particles | Alpha Blended (you can also use Additive or Additive Soft).
- Drag and drop the texture into the Particle Texture slot in the Material.
- Create an empty game object in the scene and name it AnimatedExplosion.
- Add a Particle System component to it.
- Drag and drop the Explosion material into the Renderer | Material slot.
- Check the Texture Sheet Animation option and unfold it.
- Set the Tile's X and Y fields according to your exported sprite sheet. In our example, the sheet has 8 tiles in X and 4 in Y, as shown in the following screenshot:
Texture Sheet Animation settings
- Adjust the Start Lifetime of the particles to match the frame rate of your exported sprite sheet animation. If your exported animation lasts 1 second, then the Start Lifetime of a particle should be also equal to 1 second.
- Adjust the other settings of the particle system to your liking. In this example, those settings are as follows:
- Start Lifetime: 1
- Looping: True
- Start Speed: 0
- Start Size: 5
- Emission | Rate: 1
- Shape | Shape: Sphere
- Shape | Radius: 4
- Play the game or simulate the particle system to see the effect.