Move Up and Down On Z axis

Thanks a lot! Now i can fly! However I still got one question: I’ve tried using delays and delta time but i can’t get a smooth stop. So I inherit a speed and when the space is released I want that speed to reach 0 over time (like 2 seconds). Can you give me some ideeas?