title: Can I change float value from x to y in a specified time?
body: <p>I am a beginner C# Unity coder and i need help. So i want to change a float value from x to y in specified time (to raise the x value proportionally with the time to y). I have a body that moves forward, and when i press a key i want it to slow for 5 seconds and than return to it's initial speed, but not instantly!</p>
  <pre class="lang-cs prettyprint-override"><code>public float forwardForce = 20;
  float slowDelay = 5;
  
  void update()
  {
      if (Input.GetKeyDown(&quot;e&quot;))
      {
          forwardForce = 5; //Here i want to slow it from 20 to 5 in specified time
          Invoke(&quot;AfterSlowDelay&quot;, slowDelay);
      }
  }
  
  public void AfterSlowDelay()
  {
      forwardForce = 20; // Here i want to return to his initial speed from 5 to 20 in a specified time
  }    
  </code></pre>