title: Smooth, Fast Coroutines?
body: <p>So I have a bunch of Coroutines running/working fine in my game.</p>
  
  <p>However, one of them is for a power meter, and here's the issue...</p>
  
  <p>You press the button, the power meter uses the coroutine to start filling up the power meter.  (represented by the width of a red panel)</p>
  
  <p>The goal is to make the meter fill up fast enough, as to where you can't just get "full power" every time.  However, it also has to be smooth, and look nice.</p>
  
  <p>The problem I'm facing is that my coroutine is maxed out on speed, and can't go any faster, and the meter is moving too slowly.  So to "speed up" the meter, I have to use larger width increasing increments on the red panel.  </p>
  
  <p>It works, but, this causes 2 problems.</p>
  
  <ol>
  <li>It doesn't look smooth.  (It looks choppy and jittery)</li>
  <li>It misses a whole bunch of values/possibilities.    (e.g. The bar has to increase by a unit of "50" to make it fast enough to be difficult.  But that's dumb, because that makes only 12 possibilities when stopping the meter.  And there could be up to 600!)</li>
  </ol>
  
  <p>Has anyone faced this before?  If so, what's the best approach to making a fast, but smooth power meter, that can still hit a full range of value possibilities?</p>
  
  <p>Thanks,
  Ben</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>public static IEnumerator StartPitchMeter(Player.Guy guy, float duration)
  {
  
      var dur = 0.01f;
  
      do
      {
          yield return new WaitForSeconds(dur);
  
          PlayerControls.PitchMeter += 50f;
  
          if (PlayerControls.PitchMeter &gt; 600) PlayerControls.PitchMeter = 0f;
  
          PlayerControls.pitchMeter.sizeDelta = new Vector2(PlayerControls.PitchMeter, 50);
  
      } while (!PlayerControls.stopPitch);
  
  }
  </code></pre>