Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » why does clicking the green flag twice fix lag
- JacktheEngineer
-
28 posts
why does clicking the green flag twice fix lag
hi guys so i was wondering about the “press green flag twice to reduce lag” thing on scratch.
does it really work and if so how does it work?
thanks
does it really work and if so how does it work?
thanks
- thegoofhere
-
79 posts
why does clicking the green flag twice fix lag
Magic.
Blocks can sometimes not load properly, so you'd need to click it again
Blocks can sometimes not load properly, so you'd need to click it again
- awesome-llama
-
1000+ posts
why does clicking the green flag twice fix lag
Do you have a project where this is the problem?
“click the green flag twice” is most often indicative of code that has not been given a clear order to run in. A script that resets a variable might run before that variable is used by another script, so clicking the flag again ensures that any use of that variable happens after it was already reset. Usually the scripts can be combined or triggered by broadcasts so that the order is clear and guaranteed.
Example of problematic code (don't do this):
This can be solved like this:
Alternatively with broadcasts:
(in larger projects this is a lot more useful. I prefer this method.)
“click the green flag twice” is most often indicative of code that has not been given a clear order to run in. A script that resets a variable might run before that variable is used by another script, so clicking the flag again ensures that any use of that variable happens after it was already reset. Usually the scripts can be combined or triggered by broadcasts so that the order is clear and guaranteed.
Example of problematic code (don't do this):
This can be solved like this:
Alternatively with broadcasts:
(in larger projects this is a lot more useful. I prefer this method.)
Last edited by awesome-llama (March 24, 2025 07:20:50)
- Discussion Forums
- » Questions about Scratch
-
» why does clicking the green flag twice fix lag