###

» Tue May 20, 2014 4:57 am

I don't really know much about the lerp function. In my testing to solve this question, I could not get it to count down either. However, if you know how to count up using it, you also know how to count down simply by subtracting the lerp value (which is counting up) from the old wind value.

Instead of using the lerp to change from current_wind to new_wind, always count from 0 to abs(new_wind - current_wind) then add or subtract the result from current_wind.

I am including a capx that shows the above directions set into a single action. The page simply allows you to type in a number to lerp to and shows the change over time from the previous number to the new one in a text object.

There are 2 items in the action which may need some clarity:

abs() returns the absolute (non-negative) value of the equation in the parens

NewWind - CurrentWind > 0 ? 1 : -1 means if the difference in the values is greater than 0 return 1, if not return -1. It is called a ternary operator. Google can tell you more if you want to understand it better.

I hope this helps and good luck with your project.

You do not have the required permissions to view the files attached to this post.