Z
Z
Zefirot2021-09-18 13:31:06
Unity
Zefirot, 2021-09-18 13:31:06

How to increase/decrease different numbers at the same rate?

I will try to explain what was planned - for example, there are three numbers with a start and end point

0.2 -> 1.2
0 -> 250
50 -> 1278

I need them to move smoothly to their point with a certain step, that is, so that 0.2 in 2 seconds smoothly becomes 1.2, but also in the same 2 seconds 0 becomes 250 and 50 becomes 1278, and at a uniform speed and not like with Lerp where, as the point approaches, the addition slows down ...
The question is how to make a formula for them according to which they will be added uniformly over a certain piece of time?
Please tell me how to do what I want to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-09-18
@Zefirot

each timer step (any interval of your choice) you calculate the current value of the variable:
current value = start_value_of the variable + (end_value_of_the variable - start_value_of the variable)*(difference between the current time and the start time in seconds/length of the entire interval in seconds)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question