title: Unity hit.rigidbody reference to concrete gameObject
body: <p>I've got Menu with 3d texts. Main Camera has got animations that I want to play after clicking on text. Every text has its own rigidbody and collider. I made this code:</p>
  
  <pre><code>#pragma strict
  import UnityEngine;
  var object : GameObject;
  var Run : AnimationPlay;
  function start(){
  Run = object.GetComponent(AnimationPlay);
  }
  function Update() {
      if (Input.GetMouseButtonDown(0)) {
          var hit: RaycastHit;
          var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  
          if (Physics.Raycast(ray, hit)) {
              if (hit.rigidbody != null){
                  Debug.Log("Start Game pushed");
                  Run.action = true;
                  }
          }
      }
  }
  </code></pre>
  
  <p>for Start Game button and this one:</p>
  
  <pre><code>#pragma strict
  import UnityEngine;
  var object : GameObject;
  var Run : AnimationPlay2;
  function start(){
  Run = object.GetComponent(AnimationPlay2);
  }
  function Update() {
      if (Input.GetMouseButtonDown(0)) {
          var hit: RaycastHit;
          var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  
          if (Physics.Raycast(ray, hit)) {
              if (hit.rigidbody != null){
                  Debug.Log("Back pushed");
                  Run.action2 = true;
                  }
          }
      }
  }
  </code></pre>
  
  <p>for Back button.
  The problem is it's no matter on which rigidbody I will click, both animations are starting to play and that makes weird effects. I don't know how to make a reference to concrete gameObject's rigidbody.</p>