I need that when I clicked on the left side of the screen, the squares moved to the left, and on the right side - to the right. (Black is in place of yellow, and yellow is in place of green, etc.).

screen

Please tell me how to implement it. I am new to Unity.

  • Well, your field is a two-dimensional array with 5 columns and N-rows. Accordingly, the squares are in this array and when the squares go down they occupy a width of 1 to 5 (from 0 to 4) cells .... respectively .... when pressed to the left, change the value to номер столбца минус 1 . And at the leftmost one by N (the number of columns) .... when pressed right, the opposite is true: номер столбца плюс 1 and the rightmost one is at 0 (the array starts with it) - Alexey Shimansky
  • @ Alexey Shimansky Please post your comment as a response. - Nicolas Chabanovsky

0