preventing value from going lower than another

i have a script responsible for rotating a boat relative to how fast it is going, the faster it goes the smaller the rotation is.
so im dividing my rotationSpeed by the currentPower, and its working fine.
problem is, when the currentSpeed value is at its lowest it rotates faster than i would like, i want to set a minimum rotation speed to prevent it from happening, but still keep it transitioning smoothly between those values

heres the relevant part of the script
the minimum speed is when currentPower == 0f

//Turning boat
        if (currentPower == 0f)
        {
            float rotation = Input.GetAxis ("Horizontal") * stationaryRotationSpeed;
            rotation *= Time.deltaTime;
            transform.Rotate (0, rotation, 0);
        }
        else if (currentPower != 0f)
        {
            float rotation = Input.GetAxis ("Horizontal") * rotationSpeed / currentPower;
            rotation *= Time.deltaTime;
            transform.Rotate (0, rotation, 0);
        }

You could just check for when the power drops below the acceptable value that makes it turn too fast, lets say thats 5.

// you dont want to change the value of currentPower
// so use a temporary variable

if (currentPower <5)
{  rotationPower = 5; }
else
  rotationPower = currentPower;

// Then just use the code from your second block.

float rotation = Input.GetAxis ("Horizontal") * rotationSpeed / rotationPower;
rotation *= Time.deltaTime;
transform.Rotate (0, rotation, 0);

man, oh man, that was pretty easy after all :slight_smile: somehow i completely missed this solution

thanks a bunch, only problem i have now is transitioning between the stationaryRotationSpeed (witch is set to the minimum speed) to the new rotationPower speed, and vice versa.

if i go from currentPower 1 to 0, than my rotation speed changes in an instant from its fastest to its slowest, any ideas how can i smooth this transition?

*edit - nvm, went a different way with this, thanks

OK, good luck!