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

"Mouse over" not working on 2 overlapping objects

Discussion in '2D' started by unity_K_mbpWDxwZoqew, Jun 27, 2022.

  1. unity_K_mbpWDxwZoqew

    unity_K_mbpWDxwZoqew

    Joined:
    Mar 8, 2019
    Posts:
    2
    I have a square that changes to red color when my mouse is over it, or else it stays green. It works fine alone but if I have another object behind of it(like a circle), it stops working. Changing the "order in layer" option wont fix it also. Both objects have box collider 2d. See the images. Any helps? Thank you very much.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      8.2 KB
      Views:
      196
    • 2.jpg
      2.jpg
      File size:
      8.3 KB
      Views:
      201
    • 3.jpg
      3.jpg
      File size:
      8.2 KB
      Views:
      197
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,474
    Can you share your code (Using code tags please)?