When sprite not moving

Hi, I was wondering if there was a way to run code when a sprite is moving, and stop running when a sprite is moving. any ideas?

1 Like

You just explained quantum mechanics

2 Likes

Oh wait. I meant stop when a sprite is not moving, and run when it IS moving. My bad. Anyway, I figured it out.

2 Likes

Can you tell me how? I also need it for a game. TY.

1 Like

Sure! I used the Sprite Utils extension, and used the Sprite speed block. Basically, if the sprite’s speed does not equal zero, it sets a variable to false. If it IS zero, it sets a variable to true. Here is the extension:

And here is some example code:

1 Like

Thank you!

1 Like