Prepare two buttons

If you can raise the flag with a button, we want to lower it with a button.

Let's add two buttons to make it an up button and a down button.

Add button

You can add two or more UI buttons.

But how do you distinguish between two or more buttons?
Button 1 or Button 2?

In the block program, each button is given a name and distinguished by the name.ボタンをMake it with a name and check "Is button XX pressed?" To check if it is pressed.

It's easy to add more buttons. Press "Add UI Button" from the UI.

Then you will be asked for name.
Before you make a button, you will set a name for the button. (Since the button is managed as a variable, you will decide the name of the variable.)

In alphanumeric, and give it a suitable name.We will make a button to lower the flag, so set it to "flag down".

Pressing OK does not change anything on the screen.We just increased the names that can be used.

However, if you put "Create button with" text "" in another block program and select the place called "button", the "flagdown" you created earlier will appear, so by selecting this This button is created with the name "flagdown".

Now let's lower the flag if this is pressed.

Check in loop

The final program looks like this.

Make two buttons and check the "what if" block to see if the button was clicked all the time in the loop.

Makes the flag fly when the button is clicked

And when the flagdown button is clicked, the flag is lowered.

By doing this and pressing a button, you will be able to raise and lower the flag like this!