check touch 2d object

Hoow to check on tuch at 2d gameobject. For the example If I touch the gameobject name “ball”, it can detect that I touch that ball, not only check I touch something, but specially know I touch the ball.

if the gameObject has a 2D collider, you can attach a monobehaviour to it that responds to “OnMouseDown(){}”

ooh that’s why I need then collider, because at 3d object it can detect easily, and it works thanks :smile:

how to make this post to reolve things ??

Generally people just edit the title by prefixing ‘[Solved]’