title: Running a loop inside Update()
body: <p>I need to change the scale of an object based on a value from an array (data_int[]), it should increase if the value is increasing and vice versa. the code I tried does that but I can only visualize the end result. However, I need to visualize every step in the loop.  </p>
  
  <pre><code>void Update()
  {
      if (MyFunctionCalled == false)
      {
  
          for (int i = 1; i &lt; 25; i++)
          {
              if (data_int[i] &gt; data_int[i - 1])
              {
                  transform.localScale += new Vector3(0.01f, 0.01f, 0.01f);
              }
              else if (data_int[i] &lt; data_int[i - 1])
              {
                  transform.localScale += new Vector3(-0.01f, -0.01f, -0.01f);
              }
  
          }
          MyFunctionCalled = true;
     }
    }     
   }
  }
  </code></pre>