title: Unity3d trigger event action to change a text in a canvas after another object passes through a trigger
body: <p>I'm having trouble with a script in unity</p>
  
  <p>tried something like this but it didn't work</p>
  
  <pre><code>public Collider a;
  public Text text;
  
  void update(){
  
   if(a.collision.tag == "object")
  
     text.text = "Trigger works";
  
  }
  </code></pre>
  
  <p>then attached the game elements to those public variables in the editor.</p>