Search Unity

Make particles react to emitter's velocity

Discussion in 'General Graphics' started by makeshiftwings, Apr 28, 2021.

  1. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Is there any built-in way to have the particles in a particle system stretch or change color or size in response to the emitter's velocity? Not the particle's own local speed. I mean like if the particle effect is on a torch, and you swing the torch around quickly, is there a way to have the particle color or size react to that?
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    makeshiftwings likes this.
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I don’t think our torch example would give the desired effect when “swishing” it around quickly. I don’t think we have anything simple for that.

    We could maybe add an option to the stretch billboard to stretch using emitter speed. Would that be useful?

    For a solution today, I think you would need to write a custom shader and pass in the necessary particle vertex streams to get the desired effect: https://docs.unity3d.com/Manual/PartSysVertexStreams.html
     
  4. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Being able to stretch the billboard by the emitter's speed instead of (or in addition to) the particle's local speed would be great; I think a lot of people would have a use for that. Inherit Velocity and Emission by Distance instead of just Time are working pretty well for now.
     
    richardkettlewell likes this.
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    @richardkettlewell yeah there's that static torch with distortion effect,
    still somewhere i remember seeing gif, where the torch was moving side to side fast and the flames would react to it nicely.. checked blog all posts with particles, but couldn't find it, might had been in the forums or maybe release notes (pretty sure it was from unity).. it was showcasing some particle module or effect for that flame.
     
    richardkettlewell likes this.
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    ..finally :D

    • Particles: Lifetime by Emitter Speed Module, for controlling how long-lived particles are based on the speed of the emitter at the time they were emitted. This is for instance useful for moving fire.
    tkkulbj.gif

    https://unity3d.com/unity/whats-new/2020.1.0
     
  7. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Oh, that's perfect..... unfortunately I'm stuck on Unity 2019 for this project. But, maybe someday... :D
     
    richardkettlewell likes this.