Search Unity

Overlapping Buttons!

Discussion in 'UGUI & TextMesh Pro' started by SP-Designs, Jan 24, 2016.

  1. SP-Designs

    SP-Designs

    Joined:
    Oct 13, 2015
    Posts:
    184
    Hello there programmers! I am making a 2d game and i created a level select menu with the new UI system i belive but now, i have 4 buttons and each one loads a level.However, each button overlaps the other so they cannot be clicked... here's how it looks : Unity 2016-01-24 17-24-32-95.png
    Any ideas on how to fix this?
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    Simple answer is NOT to overlap them, else the UI inpu system will simply get confused when raycasting to the object.
    Ensure your Button graphics fit the Rect Transfor and ensure the areas do not overlap

    Hope that helps
     
  3. SP-Designs

    SP-Designs

    Joined:
    Oct 13, 2015
    Posts:
    184
    Everything was alright with my last button sprites but when i changed the image it messed up like i showed you above, is that a problem with the new button image? maybe the scale is too big?
     
    ErinG0427 likes this.
  4. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    By default it will resize the RectTransform to the image. Just check your layout.
    Also try simply recreating the layout in a new scene and see if you can duplicate the issue.
     
  5. SP-Designs

    SP-Designs

    Joined:
    Oct 13, 2015
    Posts:
    184
    I have tried to recreate the menu in a new scene but the issue is still the same, the rectl. transform causes it but it does not resize form what i can see!
     
  6. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    Can you drop/create that menu in a sample scene/project and put it on a dropbox or somewhere, then I'll see if I can figure out what's going on.
     
  7. SP-Designs

    SP-Designs

    Joined:
    Oct 13, 2015
    Posts:
    184
    Yes simon i will send you a link to my project in pm!
     
  8. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    Ok, got the PM, will check out the sample asap and get back to you
     
  9. SP-Designs

    SP-Designs

    Joined:
    Oct 13, 2015
    Posts:
    184
    Ok thanks! I'll be waiting :p
     
  10. SkyKiT

    SkyKiT

    Joined:
    Nov 5, 2022
    Posts:
    1
    So, If you NEED them to overlap for some design reasons, like Button In Button, you can make an empty container in the editor and put them both inside it. By changing the order in editor you can decide what button it in front. Make sure not to make one child of another.