Let me explain you what i want to do. I have 2 Sprites "redBox" & "greenBox" and both have variable "value"
I created redBox on 5x5 grid and set their variable to
0,1,2,3,4
0,1,2,3,4
0,1,2,3,4
0,1,2,3,4
0,1,2,3,4
after that i create "greenBox" randomly over the "redBox" i.e. 8 times
see this image
Now I want to set values to "greenBox' according to number of "greenBox" are over the each row of "redBox" for example: in above image 3 "greenBox" are in first row then value needs to be 0,1,2 and in third row there are 2 "greeBox" so value will be 0,1 and so on.
this is what i am trying to do.