Search Unity

Is trail renderer possible to change material without changing previous material ?

Discussion in 'General Graphics' started by wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU, Aug 9, 2021.

  1. wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    Joined:
    Aug 6, 2021
    Posts:
    17
    I‘m trying to make a colorful pen with trail renderer, and I have done a great job for writting, next I wanna change its materail to paint(in one trail), but the materail changed, the whole trail's color changed. So I wanna ask that can trail renderer change color partially? How can I keep the trail has already made unchange?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    You'll need to spawn a new unique trail component for each material.
     
  3. wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    Joined:
    Aug 6, 2021
    Posts:
    17
    Yes. I tried to do that, and it can work very well, but that's not I want. Sorry I forgot to tell you how I change 'material'. I make a palette with red, green and blue, changing color by making a animation of material, so that I can use all colors I want.

    So I'm actually 'changing color' but not 'changing materail', bad expression:oops:. So the problem is that how can I do the title's do with using this animation? Or.. is it possible to do that?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Ah. To do that you want to use a particle system with a trail module enabled instead of the trail component. You can change the color of the particle system and not have it update the entire trail. Just make sure you turn off Resimulate while in the editor preview otherwise it will update the whole trail, at least when you’re in the editor.
     
    richardkettlewell likes this.
  5. wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    wechat_os_Qy0yuIXc8nH08PQhu0hMZuRMU

    Joined:
    Aug 6, 2021
    Posts:
    17
    Thank you so much! I used particle system before, but I never noticed it has a trail module,that suprises me!