title: Access a variable from another script using GetComponent
body: <p>In unity (the game engine)
  I have two scripts</p>
  
  <pre><code>CharacterSelect.js
  CarCameraScript.js
  </code></pre>
  
  <p>I want to access the variable</p>
  
  <pre><code>selectedPlayer
  </code></pre>
  
  <p>FROM characterSelect.js IN CarCameraScript.js</p>
  
  <p>That variable currently looks like this:</p>
  
  <pre><code>var selectedPlayer : int = 0;
  </code></pre>
  
  <p>From what i hear is it has something to do with getcomponent. Any help would be appreciated</p>