How to increase camera2d speed gradually?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By padua
:warning: Old Version Published before Godot 3 was released.
:bust_in_silhouette: Reply From: avencherus

You would move the camera manually during fixed processing. Then take the desired position, and subtract from it the current position. Take that difference and multiply it by some factor, and add the result to the current position.

Speed Factor = 0.9
Difference = Desired Position - Current Position
New Position = Current Position + Difference * Speed Factor

Then decide what factor you like, and when or if you want to clamp it as it approaches 0 difference in distance.