- Home /
 
 
               Question by 
               Mohammadalk · Dec 31, 2013 at 07:38 PM · 
                colorwatermaterial colorwater procolorpicker  
              
 
              Using Three sliders (RGB) to change the sea color
How can I change the color of the sea using color picker or three sliders, one for Read color, one for Green, and one for Blue color please? I am using Water4Example (Advanced).
               Comment
              
 
               
              Answer by Grieve_physics · Jan 01, 2014 at 04:19 PM
Using GUI Sliders changing a variable, setting Colour components. Ensure to define all variables correctly as this has not been done in the sample below
 public static void SetColour (this Material material, float value) {
     Color color = material.color;
     color.a = value;
     color.r = redslidervalue;
     color.g = greenslidervalue;
     color.b = blueslidervalue;
     material.color = color;
 }
  
  
 
               *Original Code Modified from here (Credit: Jessy)
That didn't help. I am totally new to Unity. Sorry about that.
Your answer