title: Script in C# is meant to move clouds in Unity but failed to work properly
body: <p>I ran into this code in Unity that is meant to animate some clouds. It looks solid but it fails to move the object. Is there a possible error in the code? thank you for your time. I've been able write simple code to move objects back and forth but this code presented by Unity is a little out of my league. I would appreciate some feedback, thank you.</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  
  namespace RPGM.Gameplay
  {
  /// &lt;summary&gt;
  /// Performs batch translation of cloud transforms, resetting the transform position when
  /// the cloud transform position exceeds the resetRadius distance to the controller.
  /// Automatically collects and animates all it's child transforms.
  /// &lt;/summary&gt;
  public class CloudSystem : MonoBehaviour
  {
      public Vector3 windDirection = Vector2.right;
      public float windSpeed = 1;
      public float minSpeed = 0.5f;
      public float resetRadius = 100;
      Transform[] clouds;
      float[] speeds;
  
  
      void Start()
      {
          clouds = new Transform[transform.childCount];
          speeds = new float[transform.childCount];
          for (var i = 0; i &lt; transform.childCount; i++)
          {
              clouds[i] = transform.GetChild(i);
              speeds[i] = Random.value;
          }
      }
  
      void Update()
      {
          var r2 = resetRadius * resetRadius;
          for (var i = 0; i &lt; speeds.Length; i++)
          {
              var cloud = clouds[i];
              var speed = Mathf.Lerp(minSpeed, windSpeed, speeds[i]);
              cloud.position += windDirection * speed;
              if (cloud.localPosition.sqrMagnitude &gt; r2)
              {
                  cloud.position = -cloud.position;
              }
          }
      }
  
      void OnDrawGizmos()
      {
          Gizmos.DrawWireSphere(transform.position, resetRadius);
      }
      }
      }
  </code></pre>