Thank you Thomas for your reply. this is good idea. What I think is that attribute Robot_Move should be written inside a function that repeats the value of attribute Robot_Move as a repeating loop until the limit of 5, then moves from 5 to 0 again, and this causes the robot's legs to repeat in The distance becomes 5. and another idea is to add the value of attribute Robot_Move to its inverse value, if the maximum value of attribute Robot_Move is 20, then by adding the inverse value of this attribute to the normal state, every time we change attribute X, its value becomes 20, and this number is Negative 20 and positive 20 are repeated in a loop, which causes the robot's legs to move
However, the problem that exists in using the array for this case, as you said, does not accept the r of the presented value and gives an error. Is there a way to remove the array from the function?
my English is not very good, if there is something incomprehensible, please tell me so that I can correct it