Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug RayCasting messing up with the button interface

Discussion in '2D' started by aswii200, Aug 14, 2022.

  1. aswii200

    aswii200

    Joined:
    Jul 24, 2022
    Posts:
    7
    Hey all,
    I'm working on the pause screen for my visual novel but I have some issues with the buttons.

    I have an inventory that contains 8 buttons (the square white ones as shown below) and this seems to obstruct me from clicking the pause menu buttons.
    Screenshot (77).png
    If I turn on raycast target for the inventory buttons, the pause menu is overlapped with the inventory buttons and cannot be interacted.
    And if I turn off raycast target, the inventory buttons doesn't work when trying to interact normally.

    The pause menu and the inventory are on two separate canvas.

    How do I rectify this ?
     
  2. Dedi6

    Dedi6

    Joined:
    Jan 20, 2019
    Posts:
    119
    You can always turn on and off the raycast targetting whenever you enter or exit the pause menu.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    FYI Please note, the UI forum is here. 2D physics doesn't deal with this. All RectTransform/Canvas/UI Raycasting implementation is done via the UI.

    I only mention this because of the tags "2D Physics" and "Tilemap", neither of which are related to UI.
     
  4. aswii200

    aswii200

    Joined:
    Jul 24, 2022
    Posts:
    7
    Will look into this thanks
     
  5. aswii200

    aswii200

    Joined:
    Jul 24, 2022
    Posts:
    7
    Sure, Will post there.
    Thanks for pointing it out