title: Access Character Motor from another script
body: <p>Trying to create a run script. Access the player's CharacterMotor and increase the movement speeds but the compiler is saying the objects don't exist.
  Using the stock Fisrt Person Character Controller</p>
  
  <p>error CS1061: Type <code>UnityEngine.Component' does not contain a definition for</code>CharacterMotor' and no extension method <code>CharacterMotor' of type</code>UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)</p>
  
  <pre><code>public class PlayerRun : MonoBehaviour {
  public GameObject _player;
  private float _runSpeed = 10;
  private float _defaultSpeed;
  
  // Use this for initialization
  void Start () 
  {
      _defaultSpeed = _player.GetComponent("CharacterMotor").CharacterMotor.maxForwardSpeed;
  }
  
  // Update is called once per frame
  void Update () 
  {
      if (Input.GetKeyDown(KeyCode.LeftShift))
      {
          _player.GetComponent("CharacterMotor").CharacterMotor.maxForwardSpeed = _runSpeed;
          _player.GetComponent("CharacterMotor").CharacterMotor.maxSidewaysSpeed = _runSpeed;
          _player.GetComponent("CharacterMotor").CharacterMotor.maxBackwardsSpeed = _runSpeed;
      }
      else
      {
          if (_player.GetComponent("CharacterMotor").CharacterMotor.maxForwardSpeed == _runSpeed)
          {
              _player.GetComponent("CharacterMotor").CharacterMotor.maxForwardSpeed = _defaultSpeed;
          _player.GetComponent("CharacterMotor").CharacterMotor.maxSidewaysSpeed = _defaultSpeed;
          _player.GetComponent("CharacterMotor").CharacterMotor.maxBackwardsSpeed = _defaultSpeed;
          }
      }
  }
  </code></pre>
  
  <p>}</p>