- Home /
Water turning dark at night
how do i go about making water turn dark at night to go along with my day/night cycle ive tried using this but it dosent change anything i attached it to my water i understand i will probaly need to call is night and is day from my time of day script but im not sure how i can do this
var Water : GameObject;
var IncludeWater = false;
var WaterNight : Color;
var WaterDay : Color;
if (IncludeWater == true)
{
Water.renderer.material.SetColor("_horizonColor", Color.Lerp (WaterNight, WaterDay);
}
Comment
oh and this is the tod im using http://modmonkeys.net/dat/doc/timeofday/class_t_o_d___sky.html
I don't think this code would work as Color.Lerp takes three arguments, you have your from and to arguments in there, but not the actual lerp value.
You'll also need to set IncludeWater to true at some point, or the color of the water will never change.
Your answer
![](https://koobas.hobune.stream/wayback/20220613135020im_/https://answers.unity.com/themes/thub/images/avi.jpg)