Search Unity

Bug Trail Renderer changes end shape when emission is disabled

Discussion in 'General Graphics' started by MikeGDev, Mar 1, 2023.

  1. MikeGDev

    MikeGDev

    Joined:
    Dec 19, 2017
    Posts:
    53
    When disabling emission on the Trail Renderer the end shape goes from having 2 points to 3 points. This distorts the texture and creates an unwanted effect. Is there any way to prevent it from doing that or is it a bug?

    Trail1.png ------> Trail2.png
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    It's just how it is implemented - disabling emission sets the width to 0, so the last emitted point tapers to 0 at the first "invisible" point.

    At the time where you set emitting to disabled, perhaps adding a new point via the script api (TrailRenderer.AddPosition) at the same place would work around it. I'm not sure if it would work tho. Otherwise I'm not sure I have any other ideas.
     
    MikeGDev likes this.
  3. MikeGDev

    MikeGDev

    Joined:
    Dec 19, 2017
    Posts:
    53
    Thanks for the quick reply! However, I couldn't get the solution to work in my setup so ended up with making an alternative by having multiple cached trails and then picking one that is not currently used. This way I don't have to stop the emission as they can all run until completion.
     
    richardkettlewell likes this.
  4. maurosso

    maurosso

    Joined:
    Feb 19, 2017
    Posts:
    50
    This...is a very weird way to implement it. Come on. It screws up uv's of the geometry badly. Is there really no way around it?
    I don't want to set the width to 0...I want to stop the emission...

    How can this pass any sort of quality control?
    2021.3
     

    Attached Files: