title: C# 'Object' does not contain a definition for 'position'
body: <p>I'm trying to learn to make a game using Unity so I come across a tutorial online but I faced a problem with Parallax Scrolling. The following is my code:</p>
  
  <pre><code>public class ScrollingScript : MonoBehaviour
  {
      public Vector2 speed = new Vector2(2, 2);
      public Vector2 direction = new Vector2(-1, 0);
      public bool isLinkedToCamera = false;
      public bool isLooping = false;
  
      private List&lt;SpriteRenderer&gt; backgroundPart;
  
      void Start()
      {
          if (isLooping)
          {
              backgroundPart = new List&lt;SpriteRenderer&gt;();
  
              for (int i = 0; i &lt; transform.childCount; i++)
              {
                  Transform child = transform.GetChild(i);
                  SpriteRenderer r = child.GetComponent&lt;SpriteRenderer&gt;();
  
                  if (r != null)
                  {
                      backgroundPart.Add(r);
                  }
              }
  
              backgroundPart = backgroundPart.OrderBy(t =&gt; t.position.x).ToList();
          }
      }
  
      void Update()
      {
          Vector3 movement = new Vector3(
            speed.x * direction.x,
            speed.y * direction.y,
            0);
  
          movement *= Time.deltaTime;
          transform.Translate(movement);
  
          if (isLinkedToCamera)
          {
              Camera.main.transform.Translate(movement);
          }
  
          if (isLooping)
          {
              SpriteRenderer firstChild = backgroundPart.FirstOrDefault();
  
              if (firstChild != null)
              {
                  if (firstChild.transform.position.x &lt; Camera.main.transform.position.x)
                  {
                      if (firstChild.IsVisibleFrom(Camera.main) == false)
                      {
                          SpriteRenderer lastChild = backgroundPart.LastOrDefault();
  
                          Vector3 lastPosition = lastChild.transform.position;
                          Vector3 lastSize = (lastChild.bounds.max - lastChild.bounds.min);
  
                          firstChild.transform.position = new Vector3(lastPosition.x + lastSize.x, firstChild.transform.position.y, firstChild.transform.position.z);
  
                          backgroundPart.Remove(firstChild);
                          backgroundPart.Add(firstChild);
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>So I have an error on the line:</p>
  
  <pre><code>backgroundPart = backgroundPart.OrderBy(t =&gt; t.position.x).ToList();
  </code></pre>
  
  <p>The Error code is "CS1061" whereby it says "'object' does not contain a definition for 'position' and no extension method 'position' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)"</p>
  
  <p>I was wondering where have I gone wrong? I was following the tutorial step by step. Been searching for a solution but can't find any. Thanks in advance!</p>