Increasing speed with a max speed.

Hi!

I’m making a game where blocks fall out of the air, and the blocks their speed increase over the time.
But I want to have a max speed, so the game doesn’t become impossible.

What’s the best way to do this?

if(speed > maxSpeed){
speed = maxSpeed;
}

or

speed = mathf.Clamp(lowSpeed,maxSpeed);

Oh yeah, thanks!
Sorry for the simple question :3

Or;

speed = Mathf.MoveTowards(speed, maxSpeed, step);

No if/else stuff, just one line.