Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » sinking into the floor
- when-the-j
-
Scratcher
2 posts
sinking into the floor
Hey so I am making a project for school and am having trouble with gravity, I think I did everything just fine, even followed a tutorial to try to fix it - but whenever I jump or fall my character sinks into the ground… I don't mean they fall through the ground, they SINK slowly and then slowly rise but it makes the game nearly unplayable, here's the link if you wanna look at the code: https://scratch.mit.edu/projects/751800492/
Edit: please respond quickly because I have a little bit less than a week
Edit: please respond quickly because I have a little bit less than a week
Last edited by when-the-j (Nov. 12, 2022 13:44:56)
- The_Imaginarium
-
Scratcher
1000+ posts
sinking into the floor
The solution is very simple.
Simply go to your pink “Up/Down movement' block, and right click it.
There will be a small menu that pops up.
Select ”edit“ on the menu
The screen where you can change the inputs of the block should appear.
In the bottom left of that screen, there should a small checkbox that says ”run without screen refresh“
Click on the box so that it is check marked.
The problem should be resolved.
If your wondering why this works, the ”run without screen refresh“ option will run all the code under that block without refreshing the screen.
Scratch works by redrawing the screen every ”tick“ or ”frame“. Thus while the loop in your ”Up/Down Movement“ block was running, Scratch was redrawing the screen, making it appear that the character was sinking then rising back to the surface.
However, with ”run without screen refresh" enabled, the loop under that block will run entirely before Scratch redraws the screen.
Simply go to your pink “Up/Down movement' block, and right click it.
There will be a small menu that pops up.
Select ”edit“ on the menu
The screen where you can change the inputs of the block should appear.
In the bottom left of that screen, there should a small checkbox that says ”run without screen refresh“
Click on the box so that it is check marked.
The problem should be resolved.
If your wondering why this works, the ”run without screen refresh“ option will run all the code under that block without refreshing the screen.
Scratch works by redrawing the screen every ”tick“ or ”frame“. Thus while the loop in your ”Up/Down Movement“ block was running, Scratch was redrawing the screen, making it appear that the character was sinking then rising back to the surface.
However, with ”run without screen refresh" enabled, the loop under that block will run entirely before Scratch redraws the screen.
- Discussion Forums
- » Help with Scripts
-
» sinking into the floor

