$ ./guess_the_languageGame Dev
Game Dev · hard · #269

What is wrong with this camera follow?

void Update() {
  cam.position = Vector3.Lerp(cam.position, target.position, 0.1f);
}
  1. It never moves the camera at all
  2. It smooths faster at higher frame rates
  3. It snaps instantly to the target
  4. It moves the target instead of the camera
Covering 10% of the gap per frame means more frames close the gap faster. Use a dt-based factor such as 1 - exp(-k * dt), or SmoothDamp.
Play Game Dev ▸