Search Unity

Particle system with custom curve emitter shape

Discussion in 'General Graphics' started by GrumpkinGames, Jun 22, 2022.

  1. GrumpkinGames

    GrumpkinGames

    Joined:
    Mar 3, 2016
    Posts:
    9
    I'm planning to create a system soon where I can render arbitrary curves (bezier, or otherwise).

    Instead of just bland lines, though, I thought I could zhuzh it up a bit by having the curve emit particles.

    But the shapes module in the particle system seems rather limited in the sorts of shapes you can emit from? Any tips?
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I can think of 2 ways:

    1. Use the Mesh shape option in the Particle System, and populate a mesh with the geometry you want to emit from. You can even use the sequencing options in the Shape Module to emit particles along the edges of the mesh in order. It supports meshes that use the Lines Topology, so you can make a mesh of lines to represent the curve.

    2. Do it all in script, and simply call ParticleSystem.Emit with an EmitParams struct containing the position you want to emit from.

    Good luck zhuzhing!
     
  3. GrumpkinGames

    GrumpkinGames

    Joined:
    Mar 3, 2016
    Posts:
    9
    Oooo! This is great! I didn't realize that. ^^ I was avoiding meshes because being a triangle mesh for a 2d curve seemed super funky.

    Another great option! Thank you so much!
     
    richardkettlewell likes this.