Pausing a Mathf.PingPong at the ends
Hey folk, sorry if the title isn't too clear, but I have a Mathf.PingPong that looks like
time = Mathf.PingPong(Time.time * 0.02f, 1)
it changes the intensity of a light, making it seem like a day/night cycle, however, as soon as it reaches the end, it immediately starts lowering, which is normal, but I want it to pause for a while at each end, like an actual day and night.
I was thinking using an
if(time == 0 && count < 10){count--; return;}
and
if(time == 1 && count > 10){count++; return;}
type deal before the time = mathf, but I don't feel like it'd work, since Time.time would keep growing.
Ideas?
Would mathf.cos get kinda the effect I want?
Comment
Your answer
Follow this Question
Related Questions
what exactly does Time.time do in Mathf.PingPong? 3 Answers
Separate Numbers ? 1 Answer
Real time at the beginning of the frame 1 Answer
My enemy cube moves through walls 0 Answers