In the for-loop event, we can use wait 0.1 * loopindex seconds
to wait for 0.1 second in each loop.
However, when I try to use loopindex
at the same time, it is reset to 0. it is not a static variable in this scope.
The result is failure:
The current solution is to add a static variable to record it. But I think this is very troublesome.
I'm wondering if there is a more elegant way to do it?