Search Unity

Question Trail Renderer appear fade in animation

Discussion in 'Image Effects' started by MickyVfx, Oct 17, 2022.

  1. MickyVfx

    MickyVfx

    Joined:
    Nov 3, 2021
    Posts:
    20
    Hi.
    I`m trying to animate (fade in) the moment when the trail renderer appears because the first trails are a bit odd (a few frames) at the beginning. I`ve tried to animate disable/enable, emitting off/on even alpha for the color and none of them worked.
    Any ideas?
    Thanks
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    "Color over Trail" or "Width over Trail" can control the first bit of the trail.
    If you want to set the alpha, make sure the material/shader is transparent too.
     
  3. MickyVfx

    MickyVfx

    Joined:
    Nov 3, 2021
    Posts:
    20
    https://youtube.com/shorts/JHuDKVYJFdA
    Sorry there is a problem on the forum and I can`t embed Youtube shorts.
    Odd - first 2 frames during scale of the spawned elements (trail appears for a short time).
    Normal behavior when elements are moved.
    Timeline playback looks fine. The problem appears in Game mode.
    (Unity 2019.4.25f1)

    "Color over Trail" and "Width over Trail" seems to be from particle system trails module.
     
    Last edited: Oct 17, 2022
  4. MickyVfx

    MickyVfx

    Joined:
    Nov 3, 2021
    Posts:
    20
    I`ve found a solution.
    I`ve made a child object with the trail renderer, and I`ve animated the scale for "rect transform" of the child and "is active".
     
    Last edited: Oct 17, 2022
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Sorry you're right - they are just called "Color" and "Width" in the TrailRenderer.
    (https://docs.unity3d.com/Manual/class-TrailRenderer.html)

    Glad you found a fix!