I have converted my project to URP and suddenly I found the situation where my Raycast code even is working beneath the collider (other layer colliders):
if (DisplayMessage.Click && Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 1000f, layermask))
I corss check the signature of raycast it is fine and the collider it self. Is there any changes in URP? Here is the way i am setting the layer:
int layermask => LayerMask.GetMask("Interact");
Scenario: In my scene, I have a plane (Default Layer) and a cube(Interact layer). The cube is beneath the Plane. But my camera Detecting the cube on mouse pointer and bypassing the Floor. The raycast should acctually not work if there any object of the desired layer.