Search Unity

RayCast Hit

Discussion in 'Scripting' started by marty, Apr 2, 2007.

  1. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    When I cast a ray with RayCast, is the RaycastHit that is returned for the first or last collider hit?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The first...it wouldn't be too useful otherwise.

    --Eric
     
  3. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
  4. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    So, it is just the first one.

    Seemd logical to me too.
     
  5. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Yeah, I saw that, Matt.

    I'm getting some inconsistent result with RayCast. Must be a bug in my code.

    Thanks, all!