Search Unity

Discussion Raycast Precedence when there is an Overlay Camera

Discussion in 'Universal Render Pipeline' started by TheHeftyCoder, Mar 10, 2023.

  1. TheHeftyCoder

    TheHeftyCoder

    Joined:
    Oct 29, 2016
    Posts:
    91
    Hello. I've encountered a problem with camera overlays. I have one Main Camera for the game and one Overlay Camera for the UI. Despite the Overlay Camera being.. well, an overlay, Raycasts give precedence to the Main Camera. So, a Raycast from the Main Camera overwrites a Raycast from the Overlay Camera. Is there a way to fix this?