I can’t seem to find a simple example of this anywhere. I don’t have much knowledge regarding sine waves but I’m more than certain that’s what I need to use for this. I’ve also tried Mathf.PingPong but I can’t seem to get that working correctly either. I honestly don’t even know what to do to do this without using some crappy if (value > max) go backwards etc.
There must be an equation, that when passed an elapsed time, can go from min to max then back to min once the elapsed time reaches the desired duration.
For example with a duration of 1 second: Elapsed Time of 0 return value = 0 Elapsed Time of 0.5 return value = 1 Elapsed Time of 1 return value = 0