Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make it not "lag" when you hold a button to make a thing move?
- MrSuperGamer
-
32 posts
How do you make it not "lag" when you hold a button to make a thing move?
In my project Pong! (https://scratch.mit.edu/projects/167534320/) I want to make a two player paddle mode. Previously I used the mouse pointer but in this case it is different and i am having a problem
but when i hold it, it moves a bit, then stops, then moves as normal. however, i want to stop the bit where it “lags” and stops to make the game more smooth. how would i go about doing this (sorry for basic SPaG)
but when i hold it, it moves a bit, then stops, then moves as normal. however, i want to stop the bit where it “lags” and stops to make the game more smooth. how would i go about doing this (sorry for basic SPaG)
- MrSuperGamer
-
32 posts
How do you make it not "lag" when you hold a button to make a thing move?
i gtg and won't be able to reply for a few hours, but i will be grateful of any help you could give 

- Happysoul05
-
100+ posts
How do you make it not "lag" when you hold a button to make a thing move?
Do not use hate block use boolean.
the hat gets activated when a button is pressed first time.
But boolean checks if it is pressed.
the hat gets activated when a button is pressed first time.
But boolean checks if it is pressed.
- deck26
-
1000+ posts
How do you make it not "lag" when you hold a button to make a thing move?
What you're seeing is the way the hardware acts when you press and hold a key - it doesn't repeat immediately, there's a slight pause before you get a stream of that character. If you're pressing if the key is down that's a different thing - you're chcking for a physical condition so the way the keyboard buffer works doesn't affect things.
- RokCoder
-
1000+ posts
How do you make it not "lag" when you hold a button to make a thing move?
What you're seeing is the way the hardware acts when you press and hold a key - it doesn't repeat immediately, there's a slight pause before you get a stream of that character.
If you press and hold a key when editing text (email, notepad, word processor or whatever) you'll see this exact same effect.
- MrSuperGamer
-
32 posts
How do you make it not "lag" when you hold a button to make a thing move?
Do not use hate block use boolean.
the hat gets activated when a button is pressed first time.
But boolean checks if it is pressed.
Thx your suggestion really helped
What you're seeing is the way the hardware acts when you press and hold a key - it doesn't repeat immediately, there's a slight pause before you get a stream of that character. If you're pressing if the key is down that's a different thing - you're chcking for a physical condition so the way the keyboard buffer works doesn't affect things.
i know that but i was asking because I know that other scratch games can manage to move a character held forward instantly without a pause
- Discussion Forums
- » Help with Scripts
-
» How do you make it not "lag" when you hold a button to make a thing move?