A 2d game map scene in unity There is an object above a titlemap that contains a collider. This object also contains a collider. I use onmousedown to determine whether the object is clicked. I make sure that all settings are normal, including their layer, rendering order, and so on. After startup, this object can normally get click events through onmousedown. When I refresh the titlemap and use settile, problems begin to appear. At this time, I click this object again and find that the click event is intercepted by the titlemap. It feels that the layer where the titlemap is located has been upgraded.
I'm very confused, I found almost all the articles about onmousedown and ray detection on the Internet, but they didn't solve my problem.
In run mode, in the case of titlemap intercepting events, I manually activated the object and found that the problem disappeared.