Question by
myintrog · Jan 06, 2021 at 01:20 PM ·
unity 5post processing
GetKey decreasing the value per frame by time.delta
I want to make an GetKey on mouse1 it be decrease the "timeofvalue" to 0 by time.delta or fixed delta it doesnt matter pls help
if (Input.GetKey(KeyCode.Mouse1) && timedown == true)
{
timeofvalue += 0.01f * Time.fixedDeltaTime;
vignette.intensity.value = timeofvalue;
}
if (Input.GetKeyUp(KeyCode.Mouse1))
{
timeofvalue = 0.30f;
vignette.intensity.value = timeofvalue;
}
Comment
Best Answer
Answer by myintrog · Jan 06, 2021 at 04:59 PM
i made a if statment to check vignette can be change or not ? and if it is then runs my code
if (vig == false)
{
if (timeofvalue1 <= 0.30f)
{
vig = true;
}
else
{
timeofvalue1 -= 0.02f * Time.fixedDeltaTime;
vignette.intensity.value = timeofvalue1;
}
}
Your answer
Follow this Question
Related Questions
why is my lightmap getting changed when I change my camera perspective 0 Answers
Post Processing Builds Hangs on iOS! 0 Answers
Material not rendering correctly on Submesh 0 Answers
'Spawn scene object not found 1' Error 4 Answers
Wheel Collider 0 Answers