Hello
I have three objects. the camera, the player and the destination.
Every tick the camera follows the player with a lerp motion.
Every tick-> camera set Y-> lerp(self.Y, player.Y, 0.05)
Now after an event triggers I need the camera to go to the destination instead of the player.
After event trigger->
Every tick-> camera set Y-> lerp(self.Y, destination.Y, 0.05)
Doing so causes a 'jerk' in motion when the camera switches from the player to the destination. I believe this is because of the interpolation variable (0.05 in the above case) as the distance between the player and the destination causes the camera to gain or lose speed.
How can i calculate the the interpolation variable to be put in the event ( when the camera switches from player to destination or vice versa) ?
Are there any better workarounds?
Thank you