0

Image

I have a problem with repeat loop. If I write this code 10 times it works but, I face bugs when I use a repeat loop. Can someone help? Is there any settings which I need to change to use repeat loop. I saw from a video, and everything works fine there.

I need help for repeat loop.

1
  • 1
    Repeat is not broken, but by default, it has a built-in delay of 1/30 second per iteration, which may have its effect on race conditions in parts of your code you have not revealed. Read this wiki article to learn how to eliminate the delay. Commented Jun 12, 2023 at 8:59

1 Answer 1

0

As the comment from Ruud Helderman points out,the repeat loop in scratch has a 1/30 delay because it renders every action one by one,to avoid this,you need to create a custom block and tick the run without screen refresh,this will make it so that the screen only gets rendered after all of the actions are done and removes the delay.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.