Savas Adar
Savas Adar

Reputation: 4262

Unity Button Click doesn't work When overlap a have collider2d object in another canvas

I am developing a 2d game with Unity. I have a popup settings dialog and When Player clicked settings button it coming to screen on the other objects.

Game objects have got Collider2d component and If a button over an game object which has Collider2d compopnent, Button click action doesn't work.

I use different layers and canvas, and I set z index -20 and more but result is same button click doesn't work.

Here is screen shots; game and scene windows descriptions

Upvotes: 0

Views: 2758

Answers (1)

Savas Adar
Savas Adar

Reputation: 4262

The problem was not only about collider overlapping. First part of the problem was image and button overlapping.

I removed the raycast target for Image components in a grid.

enter image description here

But already I can't click button when overlap with a 2d collider.

Upvotes: 2

Related Questions