Right now, we can change how far the chest goes, and the speed (how far it goes each frame), but if we wanted to make it last a specific number of seconds, we would have to do some guess-and-check approximation. Also, if anyone’s game is running slower, that will also slow down this animation.
What we would like to do instead is to be able to tell the program how many seconds we want the animation to last, and how far the chest needs to go, and have it calculate for us how much to move the chest each frame.
We can think of this as a percentage. When the time is 50% done, we would like the animation to be 50% done as well.