How do I progressively slow down my velocity of my walk speed according to time?

I’m trying to get my character to slowly get slower and slower as they walk, but for some reason my equation doesn’t seem to do that. my suspicions is that performance.now() needs to be updated in the animate function somehow but I’m not sure how to do it.

I did;
let speed = 5 - (0.1 + (performance.now()/1000)) ;

and the equation is for it’s velocity is:

velocity.x -= velocity.x * speed * delta;
velocity.z -= velocity.z * speed * delta;

when I just put a normal number for speed, whatever number I put it changes the characters speed; so I know that works, but trying to get his speed to change over time doesn’t seem to work, so what am I missing

Your computations are physically incorrect. You can’t multiply speed with velocity.

Speed is a scalar value which is multiplied with a normalized direction vector to produce a velocity. Try it like so: Edit fiddle - JSFiddle - Code Playground

An even more correct physical model would be to derive the velocity from force and mass. This would allow you to compute an acceleration (force/mass) which would then affect the velocity.