Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help with adding input delay
- xX__Eggs__Xx
-
Scratcher
4 posts
Help with adding input delay
Okay, so I want to add input delay to a thing so it follow the player's exact movements, but with half a second of delay. I tried using the wait block, but it either still goes to the player's exact position, just updating once every half a second, like this:
or it was the player's movement code, but it only moved every half a second, like this:
i even tried a thing where there was a timer that would increment every frame the key was pushed, but that didn't work. it looked like this:
I need input lag akin to that of Badeline from Celeste, but none of the methods i've tried have worked, and i can't find anything that works online.
forever
wait (0.5) secs
set x to ([X position v] of [Hitbox v])
end
or it was the player's movement code, but it only moved every half a second, like this:
foreverI then started looking up methods, but i couldn't find anything like what i was looking for, it was all just people trying to fix input lag
if <key [Right arrow v] pressed?> then
wait (0.5) secs
change x by (4)
end
end
i even tried a thing where there was a timer that would increment every frame the key was pushed, but that didn't work. it looked like this:
foreverTl,dr;
if <key [Right arrow v] pressed?> then
if <(TimerThing) > [15]> then
change x by (4)
end
change [TimerThing v] by (1)
end
if <not <key [Right arrow v] pressed?>> then
set [TimerThing v] to [0]
end
end
I need input lag akin to that of Badeline from Celeste, but none of the methods i've tried have worked, and i can't find anything that works online.
- awesome-llama
-
Scratcher
1000+ posts
Help with adding input delay
Would this be suitable?
1 sec behind variable - https://scratch.mit.edu/projects/499121338/
The idea is that the input is being recorded and played back later.
1 sec behind variable - https://scratch.mit.edu/projects/499121338/
The idea is that the input is being recorded and played back later.
Last edited by awesome-llama (Feb. 3, 2025 03:03:21)
- xX__Eggs__Xx
-
Scratcher
4 posts
Help with adding input delay
Update: i found the solution!
I decided to look through deltarune overworld engines to see if there were any that'd work, and i found one!
https://scratch.mit.edu/projects/676777490/
i took the code from the kris walk and susie walk sprites, changed it a bit to suit my needs, and it worked!
so basically, this is the code i'm using:
I decided to look through deltarune overworld engines to see if there were any that'd work, and i found one!
https://scratch.mit.edu/projects/676777490/
i took the code from the kris walk and susie walk sprites, changed it a bit to suit my needs, and it worked!
so basically, this is the code i'm using:
forever
if <(attack) = [1]> then
delete all of [list v]
set [Clone thing v] to [0]
repeat (10)
create clone of [myself v]
change [Clone thing v] by (1)
wait (0.5) secs
end
end
wait until <not <(attack) = [1]>>
end
when I start as a cloneSry if i messed anything up, i'm new to this part of scratch
forever
insert ([X position v] of [Hitbox v]) at (1 v) of [list v]
if <[Clone thing] = [1]> then
set x to (item (10 v) of [list v] :: list)
end
end
Last edited by xX__Eggs__Xx (Feb. 3, 2025 03:04:26)
- xX__Eggs__Xx
-
Scratcher
4 posts
Help with adding input delay
Would this be suitable?yes, that would've worked pefectly
1 sec behind variable - https://scratch.mit.edu/projects/499121338/
The idea is that the input is being recorded and played back later.
i am sorry i didn't see it earlier
- Discussion Forums
- » Help with Scripts
-
» Help with adding input delay

