Discuss Scratch
- PayPayFriday
-
Scratcher
48 posts
Lerp Block
Hi! I was wondering if you could add a lerp block in a new tab called “Numbers”. I'll show you what I want it to look like:
(lerp from (…) to (…) % (50) :: #74bc76
(lerp from (...) to (...) % (50) :: #74bc76Here is the block code:
(lerp from (…) to (…) % (50) :: #74bc76
- Za-Chary
-
Scratcher
1000+ posts
Lerp Block
What does “lerp” mean in this context, and how can it be used?
- Myst--
-
Scratcher
100+ posts
Lerp Block
What does “lerp” mean in this context, and how can it be used?Like Za-Chary said, I am confused about what this block would do. What does lerp mean?
- -gr
-
Scratcher
1000+ posts
Lerp Block
What does “lerp” mean in this context, and how can it be used?
Like Za-Chary said, I am confused about what this block would do. What does lerp mean?

I'm confused as well.
- lolecksdeehaha
-
Scratcher
1000+ posts
Lerp Block
What does “lerp” mean in this context, and how can it be used?Tweening values. I'd assume you'd use a time limit instead of a percentage. Think the glide block, but a specific value.
My version of it:
(lerp from (…) to (…) for (2) secs :: #74bc76)
- Super_Scratch_Bros20
-
Scratcher
1000+ posts
Lerp Block
What does “lerp” mean in this context, and how can it be used?Tweening values. I'd assume you'd use a time limit instead of a percentage. Think the glide block, but a specific value.
My version of it:(lerp from (…) to (…) for (2) secs :: #74bc76)
Oh, okay.
If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.
- lolecksdeehaha
-
Scratcher
1000+ posts
Lerp Block
Here's some I thought of:~snip~
Oh, okay.
If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.
- tween from () to () for () secs
- smooth change from () to () for () secs
- tween value smoothly from () to () for () secs
- Super_Scratch_Bros20
-
Scratcher
1000+ posts
Lerp Block
Here's some I thought of:~snip~
Oh, okay.
If this gets implemented, there’s no way I’d support calling it a “lerp block.” New Scratchers — and even regular Scratchers —would be incredibly confused. I’m not sure what would be a proper substitution, however.Some are a bit long, however.
- tween from () to () for () secs
- smooth change from () to () for () secs
- tween value smoothly from () to () for () secs
You know what? I have a better solution.
glide () seconds from x: () y:() to x: () y: () ::motion
- lolecksdeehaha
-
Scratcher
1000+ posts
Lerp Block
What? That's… not this suggestion though~snip~
You know what? I have a better solution.glide () seconds from x: () y:() to x: () y: () ::motion
Here, have a actually relevant definition for lerp
- medians
-
Scratcher
1000+ posts
Lerp Block
It’s a programming term.What does “lerp” mean in this context, and how can it be used?Like Za-Chary said, I am confused about what this block would do. What does lerp mean?
I'm confused as well.
- PayPayFriday
-
Scratcher
48 posts
Lerp Block
dude in this case, i want the block to be
(lerp from (…) to (…) % (50) :: #74bc76
- SpinningCube
-
Scratcher
100+ posts
Lerp Block
“lerp” is short for linear interpolation.
It's basically blending between two numbers
Here's a definition (not optimized):
Examples:
At 0%, number a is returned
At 100%, number b is returned
At 50%, the number halfway between a and b is returned
At 25%, the number 1/4 of the way from a to b is returned
Usually instead of 0% to 100% a number between 0 and 1 is used, but this could also work.
It's basically blending between two numbers
Here's a definition (not optimized):
define (lerp from (a::custom) to (b::custom) % (percentage::custom) :: operators
return ((((1) - ((percentage::custom) / (100))) * (a::custom)) + (((percentage::custom) / (100)) * (b::custom))) :: custom
Examples:
At 0%, number a is returned
At 100%, number b is returned
At 50%, the number halfway between a and b is returned
At 25%, the number 1/4 of the way from a to b is returned
Usually instead of 0% to 100% a number between 0 and 1 is used, but this could also work.
Last edited by SpinningCube (July 11, 2022 17:19:39)
- Sliverus
-
Scratcher
1000+ posts
Lerp Block
Support, I think lerp blocks would quickly become my favorite blocks as they're so useful in mathematics
But if this gets implemented, don't change the name to something simple, keep calling it lerp
But if this gets implemented, don't change the name to something simple, keep calling it lerp

- ScolderCreations
-
Scratcher
1000+ posts
Lerp Block
I like this block and I think it would be very useful. However, I'm sure there's a better way to word it. Most people aren't going to understand what that means, so perhaps pick a name that makes it clear what it's doing?
- musicROCKS013
-
Scratcher
1000+ posts
Lerp Block
Would there be a way to toggle between linear and nonlinear?
- ScolderCreations
-
Scratcher
1000+ posts
Lerp Block
Would there be a way to toggle between linear and nonlinear?No. Math shouldn't have these kind of settings. It's math.
- Sliverus
-
Scratcher
1000+ posts
Lerp Block
I like this block and I think it would be very useful. However, I'm sure there's a better way to word it. Most people aren't going to understand what that means, so perhaps pick a name that makes it clear what it's doing?But lerp is funnier, and they can just ask about it to another Scratcher or in QAS











