title: Unity Error: UnityEngine.Component' does not contain a definition for `velocity'
body: <p>I am very new to C#, so forgive me if this is obvious. </p>
  
  <p>I am following the steps in <a href="http://www.instructables.com/id/Make-A-2D-Infinite-Runner-with-Unity/step6/The-Robot-Controller-Script/%22this%20tutorial%22" rel="nofollow noreferrer">this tutorial</a> and have run into a problem on step six. The error it gives is this: The error it gives is this: </p>
  
  <pre><code>UnityEngine.Component' does not contain a definition for `velocity' and no extension method `velocity' of type `UnityEngine.Component' could be found. Are you missing an assembly reference?'
  </code></pre>
  
  <p>Here is the code: </p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class RobotController : MonoBehaviour {
  //This will be our maximum speed as we will always be multiplying by 1
  public float maxSpeed = 2f;
  //a boolean value to represent whether we are facing left or not
  bool facingLeft = true;
  //a value to represent our Animator
  Animator anim;
  // Use this for initialization
  void Start () {
    //set anim to our animator
    anim = GetComponent&lt;Animator&gt;();
  
  }
  
  // Update is called once per frame
  void FixedUpdate () {
  
    float move = Input.GetAxis ("Horizontal");//Gives us of one if we are moving via the arrow keys
    //move our Players rigidbody
    rigidbody2D.velocity = new Vector3 (move * maxSpeed, rigidbody2D.velocity.y);
    //set our speed
    anim.SetFloat ("Speed",Mathf.Abs (move));
    //if we are moving left but not facing left flip, and vice versa
    if (move &lt; 0 &amp;&amp; !facingLeft) {
  
     Flip ();
    } else if (move &gt; 0 &amp;&amp; facingLeft) {
     Flip ();
    }
  }
  
  //flip if needed
  void Flip(){
    facingLeft = !facingLeft;
    Vector3 theScale = transform.localScale;
    theScale.x *= -1;
    transform.localScale = theScale;
  }
  }
  </code></pre>
  
  <p>The error is on line 23: </p>
  
  <pre><code>rigidbody2D.velocity = new Vector3 (move * maxSpeed, rigidbody2D.velocity.y);
  </code></pre>