title: Unity: Object is not being detected by raycast for highlighting
body: <p>I followed this <a href="http://denis-potapenko.blogspot.com/2013/03/task-3-object-selection-and-highlight.html" rel="nofollow noreferrer">tutorial</a> on object selection. However, when I import my <code>.obj</code> assets and try to select/highlight them, it appears that the raycaster does not pick them up. Nothing happens when my mouse clicks on my .obj object. I added the necessary colliders (box collider even mesh collider) and nothing happens. </p>
  
  <p>What am I doing wrong? </p>
  
  <p>I didn't change the code from the source provided. I just imported my object file to the scene and added the necessary physics. </p>
  
  <p>All I want to do is highlight my <code>.obj</code> file via <code>onMouseDown</code>. </p>
  
  <p>AppRoot.cs:</p>
  
  <pre><code>using UnityEngine;
  using System;
  
  public class TransformObject
  {
      ///////////////////////////////////////////////////////////////////////////
      #region Variables
  
      // variables
  
      #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
      private float RotationSpeed = 1500;
      private float MoveSpeed = 50.0f;
      private float ZoomSpeed = 15.3f;
      #endif // UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
  
      public float MinDist = 2.0f;
      public float MaxDist = 50.0f;
  
      private Transform mMoveObject = null;
  
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  
      ///////////////////////////////////////////////////////////////////////////
      #region Public methods
  
      /// &lt;summary&gt;
      /// 
      /// &lt;/summary&gt;
      public TransformObject()
      {
          EnabledMoving = true;
      }
  
      /// &lt;summary&gt;
      /// Sets transform that will be used as "center" of the rotate / pan / zoom
      /// &lt;/summary&gt;
      public void SetTransformRotateAround(Transform goMove)
      {
          mMoveObject = goMove;
          if (mMoveObject == null)
          {
              Debug.LogWarning("Error! Cannot find object!");
              return;
          }
      }
  
      public void Update()
      {
          if (!EnabledMoving)
          {
              return;
          }
  
          Vector3 dir = mMoveObject.position - Camera.main.transform.position;
          float dist = Math.Abs(dir.magnitude);
  
          Vector3 camDir = Camera.main.transform.forward;
          Vector3 camLeft = Vector3.Cross(camDir, Vector3.down);
          Vector3 camDown = Vector3.Cross(camDir, camLeft);
          //Vector3 camUp = Vector3.Cross(camLeft, camDir);
  
      #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
  
          float dx = Input.GetAxis("Mouse X");
          float dy = Input.GetAxis("Mouse Y");
  
          // rotate
          if (Input.GetMouseButton(0))
          {
              mMoveObject.Rotate(camLeft, dy * RotationSpeed * Time.deltaTime, Space.World);
              mMoveObject.Rotate(Vector3.down, dx * RotationSpeed * Time.deltaTime, Space.Self);
          }
  
          // move
          if (Input.GetMouseButton(1))
          {
              Vector3 camPos = Camera.main.transform.position;
              camPos += -camLeft * MoveSpeed * dx * Time.deltaTime;
              camPos += -camDown * MoveSpeed * dy * Time.deltaTime;
              Camera.main.transform.position = camPos;
          }
  
          // zoom
          if (Input.GetAxis("Mouse ScrollWheel") &gt; 0)
          {
              if (dist &gt; MinDist)
              {
                  mMoveObject.Translate(-dir * ZoomSpeed * Time.deltaTime, Space.World);
              }
          }
  
          if (Input.GetAxis("Mouse ScrollWheel") &lt; 0)
          {
              if (dist &lt; MaxDist)
              {
                  mMoveObject.Translate(dir * ZoomSpeed * Time.deltaTime, Space.World);
              }
          }
  
      #endif // UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
      }
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  
      ///////////////////////////////////////////////////////////////////////////
      #region Properties
      /// &lt;summary&gt;
      /// Gets or set value indicating if transformation is enabled
      /// &lt;/summary&gt;
      public bool EnabledMoving
      {
          get;
          set;
      }
  
      /// &lt;summary&gt;
      /// Gets game object that moves around
      /// &lt;/summary&gt;
      public Transform MoveObject
      {
          get
          {
              return mMoveObject;
          }
      }
  
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  }
  </code></pre>
  
  <p>TransformObject.cs</p>
  
  <pre><code>using UnityEngine;
  using System;
  
  public class TransformObject
  {
      ///////////////////////////////////////////////////////////////////////////
      #region Variables
  
      // variables
  
      #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
      private float RotationSpeed = 1500;
      private float MoveSpeed = 50.0f;
      private float ZoomSpeed = 15.3f;
      #endif // UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
  
      public float MinDist = 2.0f;
      public float MaxDist = 50.0f;
  
      private Transform mMoveObject = null;
  
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  
      ///////////////////////////////////////////////////////////////////////////
      #region Public methods
  
      /// &lt;summary&gt;
      /// 
      /// &lt;/summary&gt;
      public TransformObject()
      {
          EnabledMoving = true;
      }
  
      /// &lt;summary&gt;
      /// Sets transform that will be used as "center" of the rotate / pan / zoom
      /// &lt;/summary&gt;
      public void SetTransformRotateAround(Transform goMove)
      {
          mMoveObject = goMove;
          if (mMoveObject == null)
          {
              Debug.LogWarning("Error! Cannot find object!");
              return;
          }
      }
  
      public void Update()
      {
          if (!EnabledMoving)
          {
              return;
          }
  
          Vector3 dir = mMoveObject.position - Camera.main.transform.position;
          float dist = Math.Abs(dir.magnitude);
  
          Vector3 camDir = Camera.main.transform.forward;
          Vector3 camLeft = Vector3.Cross(camDir, Vector3.down);
          Vector3 camDown = Vector3.Cross(camDir, camLeft);
          //Vector3 camUp = Vector3.Cross(camLeft, camDir);
  
      #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
  
          float dx = Input.GetAxis("Mouse X");
          float dy = Input.GetAxis("Mouse Y");
  
          // rotate
          if (Input.GetMouseButton(0))
          {
              mMoveObject.Rotate(camLeft, dy * RotationSpeed * Time.deltaTime, Space.World);
              mMoveObject.Rotate(Vector3.down, dx * RotationSpeed * Time.deltaTime, Space.Self);
          }
  
          // move
          if (Input.GetMouseButton(1))
          {
              Vector3 camPos = Camera.main.transform.position;
              camPos += -camLeft * MoveSpeed * dx * Time.deltaTime;
              camPos += -camDown * MoveSpeed * dy * Time.deltaTime;
              Camera.main.transform.position = camPos;
          }
  
          // zoom
          if (Input.GetAxis("Mouse ScrollWheel") &gt; 0)
          {
              if (dist &gt; MinDist)
              {
                  mMoveObject.Translate(-dir * ZoomSpeed * Time.deltaTime, Space.World);
              }
          }
  
          if (Input.GetAxis("Mouse ScrollWheel") &lt; 0)
          {
              if (dist &lt; MaxDist)
              {
                  mMoveObject.Translate(dir * ZoomSpeed * Time.deltaTime, Space.World);
              }
          }
  
      #endif // UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WEBPLAYER
      }
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  
      ///////////////////////////////////////////////////////////////////////////
      #region Properties
      /// &lt;summary&gt;
      /// Gets or set value indicating if transformation is enabled
      /// &lt;/summary&gt;
      public bool EnabledMoving
      {
          get;
          set;
      }
  
      /// &lt;summary&gt;
      /// Gets game object that moves around
      /// &lt;/summary&gt;
      public Transform MoveObject
      {
          get
          {
              return mMoveObject;
          }
      }
  
      #endregion
      ///////////////////////////////////////////////////////////////////////////
  }
  </code></pre>
  
  <p>Constants.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  public class Constants
  {
      public const float cMaxRayCastDistance = 1000.0f;
  }
  </code></pre>