Branch node in Blueprints: if true, do this; otherwise, do that
The Branch node tests a Boolean condition: if it is true, execution continues through the True pin, and if it is false, through the False pin. It is one of the nodes used most often in Blueprints, and it is the visual version of if this happens, do that; otherwise do something else.
From the course
Taken from the hands-on project of the course; the lessons show every step on video.
What does the Branch have?
An execution input, a Boolean data input where you set the condition (true or false) and two execution outputs: True and False.
How do I test it?
- Connect a Print String to each output pin: true on the True pin and false on the False pin.
- With the condition unchecked the execution follows the False pin. Check it, compile and test: it follows the True pin.
How do I use a variable instead of the checkbox?
Create a Boolean variable, for example MyCondition, set its default in the Details panel, Get it and connect it to the Branch condition. You can also change it in real time during gameplay with a Set node.
Can I combine Branches?
Yes: a Branch followed by another Branch, or a Branch right after a Switch. The lesson's practical example is a TV power button: if the TV is on, turn it off; if it is off, turn it on, like a remote control button.
Free PDFs that go with this page
One-page guides made from the lessons, sent by e-mail.
- Flow control nodes — Branch, Switch, loops and gates on one page: what each node does and which pins to know.
- Blueprint Cheat Sheet — A free one-page PDF for Unreal Engine 4/5, made from the lessons of the course. Keep it next to your editor while you learn.
- Free PDFs
Frequently asked questions
What does the Branch node do?
It sends the execution through the True or False pin depending on a Boolean condition.
What type is the Branch condition?
A Boolean, true or false.
Can I use a variable as the condition?
Yes. Connect a Boolean variable to the condition pin.