Discuss Scratch

TemuCATalyst
Scratcher
9 posts

How to make some rotation linger, or the velocity slowly decreasing on a moving object till it stops?

I'm wondering how to do this ⬆
FancyTigerDustBall
Scratcher
81 posts

How to make some rotation linger, or the velocity slowly decreasing on a moving object till it stops?

You basically have variables “rotation speed” and “velocity”. To make both gradually decrease you do something like this:

forever
turn cw (rotation speed) degrees
move (velocity) steps
set [rotation speed v] to ((rotation speed) * (0.9))
set [velocity v] to ((velocity) * (0.9))
end

Let me know if this helps!

Last edited by FancyTigerDustBall (Oct. 12, 2026 23:56:19)

happywaffle0
Scratcher
100+ posts

How to make some rotation linger, or the velocity slowly decreasing on a moving object till it stops?

FancyTigerDustBall wrote:

forever
turn cw (rotation speed) degrees
move (velocity) steps
change [rotation speed v] by (-1)
change [velocity v] by (-1)
end

would actually just accelerate again after set rotation and velocity reaches 0, as it'll become a negative and be bigger, so change the forever to a repeat until for it to not do that.

this also works:

set [rot spd v] to [5] // or whatever number
set [vel v] to [5]
forever
turn cw (rot spd) degrees
move (vel) steps
set [rot spd v] to ((rot spd) * [0.9]) // or some number close to 1, the closer to 1 the longer
set [vel v] to ((vel) * [0.9]) // though this (both vars) is for some smooth effect
end
FancyTigerDustBall
Scratcher
81 posts

How to make some rotation linger, or the velocity slowly decreasing on a moving object till it stops?

happywaffle0 wrote:

FancyTigerDustBall wrote:

forever
turn cw (rotation speed) degrees
move (velocity) steps
change [rotation speed v] by (-1)
change [velocity v] by (-1)
end

would actually just accelerate again after set rotation and velocity reaches 0, as it'll become a negative and be bigger, so change the forever to a repeat until for it to not do that.

this also works:

set [rot spd v] to [5] // or whatever number
set [vel v] to [5]
forever
turn cw (rot spd) degrees
move (vel) steps
set [rot spd v] to ((rot spd) * [0.9]) // or some number close to 1, the closer to 1 the longer
set [vel v] to ((vel) * [0.9]) // though this (both vars) is for some smooth effect
end
Right, thanks for catching that. I was writing the response fast and forgot about that even though I've done projects that use that exact concept before.
TemuCATalyst
Scratcher
9 posts

How to make some rotation linger, or the velocity slowly decreasing on a moving object till it stops?

oh thank you!

Powered by DjangoBB