How is this done with UNİTY ?

Hi,

Would you examine the GİF?

  • I tried many ways but none of them worked.
  • You can click with the mouse on the right/left/up/down of the green box.
  • If it is not near, click with mouse is passive.

make array or matrix (double array) and check if pressed object is near the already green object.