In a game I have a specific object and two positions the object will move from and to. I already have the function for calculating current position in specific time.
It works like this:
Inputting 0 will move the object to Position 1.
Inputting 1 will move the object to Position 2.
Inputting 0.5 will move the object in the middle of the two positions.
(In the examples below, time is varying from 0 to 1) When I want to start the object slowly and stop it when it is moving fast, I use:
MoveObject(sin(time * 90))
When I want to start the object fast and stop it as it is getting slower, I use:
MoveObject(1 - cos(time * 90))
Without the effects, it's:
How do I make the object start moving slowly, move fast in the center of two positions and then get slower while reaching the second position?