title: Raycast, in Unity 3d does not detect all obstacles
body: <p>I'm trying to make a very simple race game with spheres, however, I face many problems.</p>
  
  <p>First of all, I'm trying to make a very simple AI system for opponents. </p>
  
  <p>The problem I have here is that I want opponents to detect obstacles and avoid them using Raycast but only a certain type of obstacle , a simple cube is detected.</p>
  
  <p>I've created a simple sphere as opponent and wrote a script so it can move and detect obstacles 
  Here is update function:</p>
  
  <pre><code>void FixedUpdate()
  {
      transform.Translate(Vector3.forward * Time.deltaTime * speed);
  
      if (Physics.Raycast(transform.position, transform.forward, 100.0f))
          print("There is something in front of the object!");
  
  }
  </code></pre>
  
  <p>The message is printed only when there is a cube forward and it does not detect any other obstacles. What can be so wrong? Also, is there any idea how to move left or right when opponent raycast an obstacle? </p>
  
  <p><a href="https://i.stack.imgur.com/f4j2F.png" rel="nofollow noreferrer">obstacle that is detected</a></p>
  
  <p><a href="https://i.stack.imgur.com/1hnMI.png" rel="nofollow noreferrer">hierarchy</a></p>
  
  <p><a href="https://i.stack.imgur.com/JRiAz.png" rel="nofollow noreferrer">cube01 that is child of obstacle2 that is not detected</a></p>