This page looks best with JavaScript enabled

Custom Particle Emitters in Unity 3D

 ·   ·  ☕ 1 min read

Lets build a custom particle emitter that can emit particles on the ground anywhere in a rectangle. This is the first step of lighting the grass in our grass renderer on fire.

The approach here is fairly simple, we’ll use the size of our grass “box” to identify a random point inside of our grass and then project a ray down to find the terrain. This is similar to how the grass for our terrain is generated.

Then we’ll make use of the Particle System’s Emit() methods and specifically take advantage of the ParticleSystem.EmitParams() to ste our particle’s position. This is simple, but effective and allows us to define our particle emitter in code.

Particle emission is simply done by creating a counter that tracks the number of particles that should be emitted each frame.

The Grass Renderer is on GitHub and I’m always looking for good ways to improve it! Let me know below!


Sam Wronski
Sam Wronski
Maker of things and professional software engineer. Lets make something awesome together!