Game camera movement issues

So, I made this program where the camera tracks the player. The idea is that the camera will move to a spot that’s between where it was 0.005 seconds ago and the player’s current position to create this smooth movement effect. Well, the result isn’t exactly what I hoped for.

At first, when the player moves in a straight line, the camera follows normally. But after a few seconds, it starts shaking from sideandand to side (like in movie I posted), and the shaking just keeps getting worse the longer it goes on. It’s honestly driving me nuts.

This is the program

https://preview.redd.it/1wj7zxuqsgge1.png?width=1394&format=png&auto=webp&s=4fc0cf929d50253c01026c74ac89843b20c64a0c

The variable MovementCameraDelay is set to 0.005f and EndTime is 0.25f.

MovementCameraPos is a position which at the position 3.5 above and to the right of the player, its parent object is the player, so it will move with the player.

https://preview.redd.it/q9k0s82yvgge1.png?width=464&format=png&auto=webp&s=1700ab2ee2c4622cbf17967c9a0d7625a408f047

(I hope you can understand this question, because I translated it using Google Translate and my native language is not English.)