title: Unity Call a class function from other script
body: <p>I have 2 scripts: Console and Test. I want to call "appendLogLine" function from Test script but cannot get it working.</p>
  
  <p>Console.cs:</p>
  
  <pre><code>public class ConsoleController
  {
  
      public void appendLogLine(string line)
      {
          if (line == "Unable to process command ''")
              return;
  
          Debug.Log(line);
  
          if (scrollback.Count &gt;= ConsoleController.scrollbackSize)
          {
              scrollback.Dequeue();
          }
          scrollback.Enqueue(line);
  
          log = scrollback.ToArray();
          if (logChanged != null)
          {
              logChanged(log);
          }
      }
  }
  </code></pre>
  
  <p>Test.cs:</p>
  
  <pre><code>public GameObject ConsoleObject;
  
  public void CallLog()
  {
  
      ConsoleObject.GetComponent&lt;ConsoleController&gt;.appendLogLine ("Test123");
  }
  </code></pre>
  
  <p>I get error with that: "error CS0119: Expression denotes a <code>method group', where a</code>variable', <code>value' or</code>type' was expected"</p>