Search Unity

Problem with my main Game scene. How do i click past the logo sprite?

Discussion in '2D' started by FalsAlarm, Dec 12, 2016.

  1. FalsAlarm

    FalsAlarm

    Joined:
    Dec 12, 2016
    Posts:
    21
    Hello everyone,

    I'm having a problem. I have a large logo for my game created with photoshop and it's a transparent PNG file. Currently my Unity project is setup with a Canvas element and I have an Image UI element as well as a Text UI element(I'm using this text as a button).

    The problem I'm having is that my main Logo that I created fill the entire screen and is transparent in the area where the I have the Text button. The main problem is that the button is behind the Logo image and whenever i hover over the Text button, the hover is not sent to the button because the Logo image is in the way(at least i think that's why it's not working).

    seems like whenever i move the logo away from the Text buttons, it works fine. But how do i tell the UI to set the Logo image as the background or something?
     
  2. DWit

    DWit

    Joined:
    Dec 4, 2016
    Posts:
    25
    In UI objects are drawn based on position in hierarchy. So you can move logo up in hierarchy over button and should be ok.

    Second solution: you can disable Raycast Target for logo UI Sprite so any click will skip logo and you can press button under logo.
     
    theANMATOR2b likes this.
  3. FalsAlarm

    FalsAlarm

    Joined:
    Dec 12, 2016
    Posts:
    21
    Thank you. I tried to disable Raycast Target on the image that resolved my issue. Furthermore, I found out that by placing my Text buttons as children of the Logo Image, that resolved my issues also.