Search Unity

Mesh emitter

Discussion in 'Scripting' started by Raptor5399, Apr 21, 2009.

  1. Raptor5399

    Raptor5399

    Joined:
    Sep 25, 2007
    Posts:
    94
    I want to use a particle simulation to emit a custom mesh instead of the default card that it emits.

    The reason I want to use the particle sim is because it has all the nifty controls to add randomness into the motion of the objects and I think telling it to use a custom mesh would be easier than scripting everything from scratch.

    Alternatively I could code something to instantiate the custom mesh instead but I'm a noob at coding (I got a button with an Icon to work, yay!) and would very much appreciate being pointed in the right direction.

    Thanks!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The particle system only does billboards.

    --Eric
     
  3. Raptor5399

    Raptor5399

    Joined:
    Sep 25, 2007
    Posts:
    94
    Dammit all... sigh

    Thanks again.
     
  4. Raptor5399

    Raptor5399

    Joined:
    Sep 25, 2007
    Posts:
    94
    Wait, shouldn't you be able to instantiate a mesh and have it fallow the position of the particles?
     
  5. dawvee

    dawvee

    Joined:
    Nov 12, 2008
    Posts:
    276
    If you don't mind the overhead of running a particle system + your instantiated meshes, sure, there's no reason you couldn't do that.

    Tracking the particles and instantiating meshes to match them (and destroying them in time with the particles too) could be tricky, but you could make it work. You can probably make it easier on yourself by controlling particle emission explicitly using the Emit method (rather than letting it emit on its own).