Conditionals (If-Then) in Scratch
A conditional in Scratch is an "if-then" block that lets a character make a decision: if something is true, then do something. For example, "if touching the wall, then bounce back." Conditionals are how a child teaches their characters to react sensibly, and they are the heart of nearly every game. This guide explains the idea in everyday language and shows the friendly blocks that make it work.
What is a Conditional?
We make conditional decisions all day without thinking. "If it is raining, then take an umbrella." "If the food is too hot, then wait." Each is a rule with a condition and an action.
Scratch lets children give their characters exactly these kinds of rules. The character checks, "Is this true right now?" and only acts if the answer is yes. This is what makes a project feel clever rather than just following a fixed script.
The If-Then Block
The "if-then" block lives in the Control group, the orange one. It is shaped like a bracket, similar to a loop, but it has a small six-sided slot at the top where the condition goes.
That diamond-shaped condition usually comes from the Sensing group (light blue) or the Operators group (green). For example:
- A Sensing block "touching [edge]?" can be dropped into the slot.
- Then, inside the bracket, your child places what should happen, such as "play sound" or "say Ouch!"
So the finished block reads, in plain words: "if touching the edge, then say Ouch." The character only says Ouch when it actually touches the edge. The rest of the time, nothing happens. Children find it almost magical that the character seems to "notice" things.
A Favourite Example: Collecting Coins
Conditionals shine in simple games. Imagine a cat that should score a point whenever it touches a coin:
- Use a forever loop so the cat keeps checking.
- Inside it, add an if-then block.
- In the condition slot, drop a Sensing block: "touching [coin]?"
- Inside the if-then, add blocks to change the score and play a happy sound.
Now, as your child moves the cat onto a coin, the score jumps and a cheerful sound plays. Move away from coins, and nothing happens. That is a conditional doing its quiet, clever work.
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesThe If-Else Block
Sometimes you want one thing to happen if a condition is true, and a different thing if it is false. For that, Scratch has the "if-then-else" block, also in Control.
It has two openings: the top runs when the condition is true, the bottom runs when it is false. For example:
- "if score is more than 10, then say You win, else say Keep trying."
This teaches children that a decision can have two paths, which is a wonderfully clear way to introduce the idea of choices having consequences.
Combining Conditions
As confidence grows, children can use the green Operators blocks to build richer conditions, such as "and," "or," and comparisons like "greater than." For example, "if score is greater than 10 and touching the flag" combines two checks into one rule. There is no need to rush here, but it is lovely to know how far the idea can stretch.
Tips for Parents
- Use everyday "if-then" talk at home. "If you finish your homework, then we'll play." Pointing out these real-life rules makes the coding idea feel familiar.
- Test both outcomes. After building an if-else, have your child deliberately make the condition true and then false, so they see both branches working.
- Read the block aloud as a sentence. "If touching coin, then add one point" sounds like plain English, and that is the point.
Common Mistakes
- Empty condition slot. If an if-then never acts, check that a condition block is actually placed in the diamond slot at the top.
- Action placed outside the bracket. The action must sit inside the if-then bracket, or it will run every time instead of only when the condition is true.
- Checking only once. A single if-then runs one time. To keep checking, such as in a game, it usually needs to be inside a forever loop.
Frequently Asked Questions
What is the difference between if-then and if-else? If-then does something only when the condition is true and otherwise does nothing. If-else gives two paths: one for true, one for false.
Do conditionals need loops? Often, yes. In games, a conditional usually lives inside a forever loop so the character keeps checking the condition as things change.
What's Next?
Decisions become even more powerful when paired with numbers your child can track. Read Variables in Scratch to learn how to keep score, and revisit Loops in Scratch to see why conditionals so often live inside loops. All guides are on the kids' Scratch hub.
For caring, step-by-step lessons that build these thinking skills, explore our Scratch & Coding for Kids program in Jalgaon. Join the waitlist for the next batch.
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesFounder, Infoplanet
Atul Kabra founded Infoplanet in 2001 and has spent over two decades teaching programming — C, C++, Java, databases and more — to students across Maharashtra.
Related guides
कोडिंग सुरू करायचे सर्वोत्तम वय कोणते?
मुलांनी कोडिंग सुरू करायच्या सर्वोत्तम वयाबद्दल पालकांसाठी दिलासा देणारे मार्गदर्शक — वयानुसार प्रामाणिक तयारीची लक्षणे आणि एकच योग्य वेळ नसते व घाईची मुळीच गरज नाही हा स्पष्ट संदेश.
What's the Best Age to Start Coding?
A reassuring parent's guide to the best age for kids to start coding, with honest readiness signs by age and a clear message that there is no single right time and no rush.
Scratch मध्ये Animation बनवा
Scratch मध्ये animated गोष्ट बनवण्यासाठी पालकांसाठी मायेचे मार्गदर्शक: हालचालीसाठी costumes बदलणे, sprites सहजतेने सरकवणे, संवाद जोडणे आणि backdrops ने दृश्ये बदलणे.
