imI'm using a gradient script to change dethe color of a sphere over time, but iI want a point light asociatedassociated to it to change too. the
The script imI'm using is this:
public class gradient : MonoBehaviour { public Gradient myGradient; public float strobeDuration = 2f;
public class gradient : MonoBehaviour
{
public Gradient myGradient;
public float strobeDuration = 2f;
public void Update()
{
float t = Mathf.PingPong(Time.time / strobeDuration, 1f);
GetComponent<Renderer>().material.color= myGradient.Evaluate(t);
}
}
}
the The light object accepts the script but it doesntdoesn't affect the color, i asume its.
I assume it's because this script is asociatedassociated to materials and light has no material... thanks!