OnMouseDown doesn't trigger sometimes
I'm using BoxCollider2Ds, all objects on scene have the same Z axis value (0). I'm using the new unity's pixel perfect camera controller with just 1 camera (main ortographic camera). More than 1 collider overlapping is not the problem.
Now with the same prefab, sometimes OnMouseDown triggers perfectly, and sometimes it just never triggers.
Is there a reason for this? Does it have to do with the fact that I'm using the pixel perfect camera?
@martinx09 Late to the party, but have you ever figured out a fix or what caused this? Thank you!
Answer by Qriscuit · Jul 18, 2020 at 02:49 AM
could you link us the code so that we can have a look ? that wouuld be super helpful on figuring out why the collisions are not being detected
In the mean time, remember one of the colliding object needs to have a 2D Rigidbody since two static colliders will not collide with each other.
Your answer
![](https://koobas.hobune.stream/wayback/20220612201547im_/https://answers.unity.com/themes/thub/images/avi.jpg)