I’m using Vector2.Lerp to achieve a smooth camera, but it jitters with the players acceleration. I assume this is because the player moves one pixel, then the camera will catch up to that pixel a frame or so later. How do I avoid this?
Vector2 entityPosition = new Vector2((int)(entity.position.X - Assets.gameWidth / 2 + entity.width / 2), (int)(entity.position.Y - Assets.gameHeight / 2 + entity.height / 2));
position = Vector2.Lerp(unRoundedPosition, entityPosition, 0.125f);
unRoundedPosition = position;
position = new Vector2((int)position.X, (int)position.Y);