๐Ÿค”๐Ÿ‘‰๐Ÿป HELP! How do you make something happen when something is released? ๐Ÿ‘ˆ๐Ÿป๐Ÿค”


#1

The title say everything you need to know to answer my question


#2

Explain "released" please.


#3

Do you mean something like:
When (some object in your project) is released?
Like when you are touching an object and then you let go of it?


#4

There are a couple of projects which use that. You need check if blocks and values. I think @SUPERSWAGGY made one project.

There're links on the forum too.


#5

@Valgo right! How do you do that?


#6

@KVJ What is one of the links?


#7

I REALLY NEED HELP WITH THIS!!!!!!!!!!!!!!!!!!!!! I am making the sequel to: Are you patient?

@DECODECO where did you get that awesome profile photo?


#8

Check this out.


#9

@KVJ I knew you were my Hopscotch role model for something! Thank you so much!


#10

Wut. Thank you so much :smiley:
Also, anytime.


#11

Let's see...

When Thing is pressed
Set (press) to 1
Wait ms 800
Set (press) to 0

When press=0
Do stuff


#12

On this site called "tenor."
It has really cool GIFs!


#13

@KVJ K, I want to go check out your profile on Hopscotch


#14

@DECODECO ok, thank you!


#15

Lol which one? (อกยฐ อœส– อกยฐ)


#16
When 7=7:
 Set (variable) to 10

When (Object) is pressed:
 Set (variable) to 1

When (variable)=10:
(this is your "when released" rule)

#17

Careful @MR.GAM3R, that'll be "When not pressed", which is different than When Released in that the press doesn't need to occur and the When variable = 10 event will continually loop while the object is not pressed.

Careful @DECODECO, that will execute continually when a project starts (since variables initialize as 0) & will only pause for 800ms when the object is pressed.

@Work_kids_coding
To make code execute once when an object is released, I like these 2 options which accomplish the same affect in slightly different ways. As a side benefit, there's no "overhead" with code that has to always be executing (meaning the events are only triggered during and and for a few milliseconds after a press)

In both examples the (self) Pressed variable is 0 before the press & settles back to 0 after the press to sit idle again until the next press.


#18

Still need help? If so, I can do it tomorrow.


#19

Lol sorry, my bad. Released is something different.


#20

Maybe we all answered differently because you didn't elaborate on your question?