Question by
natifranco16 · Jun 09, 2017 at 11:47 AM ·
scripting problem
Gradually changing the light intensity by clicking the mouse
I have a point light over an object and I want to increase the intensity of the light every time I click the right button of the mouse.
My originally ideas was to use Mathf.Lerp but the "t" component has to be a float. I don't know how to do it. Any ideas?
void Update () {
if (Input.GetMouseButtonDown(0))
{
lightLerp.GetComponent<Light>().intensity = Mathf.Lerp(0.0f, 8.0f, Input.GetMouseButtonDown(0));
}
}
Comment
Your answer
Follow this Question
Related Questions
How can i disable/enable slowly the blur effect using the blur script ? 0 Answers
Why when i color 4 walls of a grid 10x10 it's coloring 10,9,9,8 and not 10,10,10,10 ? 0 Answers
Is there a way to set the mass of a gameobject without using the Rigidbody component?? 2 Answers
space shooter asteroids are invisible 1 Answer
Boolean won't set false? 0 Answers