Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

How does the HitTest(Vector) function work?

Discussion in 'Scripting' started by csciguy, Dec 14, 2006.

  1. csciguy

    csciguy

    Joined:
    Dec 13, 2006
    Posts:
    22
    Hello all,

    Can anyone provide some insight as to how the HitTest(vector) function works internally?
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
  3. csciguy

    csciguy

    Joined:
    Dec 13, 2006
    Posts:
    22
    I understand the doc, as far as what it does, but I'm looking for more of the internals of how it checks the inside bounds of a gui element. What exactly of the gui element is it checking against? The bounding "box" so to speak?
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    It checks the bounding rect of the gui element. For a gui texture this is the actual size of the gui texture on screen, for a gui text it is the rectangle surrounding the text.
     
  5. csciguy

    csciguy

    Joined:
    Dec 13, 2006
    Posts:
    22
    Excellent. Thanks!