Search Unity

Set Color over life - any way to make random colours?

Discussion in 'Visual Effect Graph' started by Hi_ImTemmy, Jun 12, 2021.

  1. Hi_ImTemmy

    Hi_ImTemmy

    Joined:
    Jul 8, 2015
    Posts:
    174
    Howdy,

    I'm new to the visual effect graph.

    Is there a way to make 'Set Color over life' generate some random colour values? For instance I've set it up to go from blue to purple, but I'd like to define some colour values and have the effect randomly pick from them for the start and finish colour.



    Thanks!
     
  2. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,856
  3. Hi_ImTemmy

    Hi_ImTemmy

    Joined:
    Jul 8, 2015
    Posts:
    174
  4. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,856
  5. Hi_ImTemmy

    Hi_ImTemmy

    Joined:
    Jul 8, 2015
    Posts:
    174
    This is what you get within visual effect graph



    This is what you get with gradients in C#


    (P.S Unity - any reason HDR gradients can't be declared from script?)
     
  6. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,856
    Interesting. Do they do the same thing at runtime..meaning is the effect colors they produce the same?
     
  7. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    121
    Hey! Speaking of gradient colors, I think you are looking for GradientUsage attribute which allows to use HDR colors. You can find a bit more information about this attribute here. Gradient.gif
     
    ippdev likes this.