Boolean block allows us to to enter boolean values ("true" or "false") to be used as conditions to determine execution flow (which yellow line we'll be following next).
Boolean Branchblock, which takes a boolean as input, and executes one of two output connections depending on the value of the boolean, as seen here:
In the above example, "true" has been typed into the
Boolean block, which is then being sent as the input data into the
Boolean Branch block. When the
Boolean Branch block is run, it will trigger the top yellow connection to fire next, since that output corresponds with the "true" value it received as input. Therefore, the topmost
The example above, while very simple, is not very realistic, because no matter what, the top output of the
Boolean Branch will fire every time we run this graph, since we hard-coded its condition to be simply the value "true". The
Boolean Branch blocks in the above example are therefore pointless.
In this example, we are using a
String Branch block to check if two given strings are equal. If they are equal, it triggers the top
Set variable block, which uses a
Boolean block to assign the value "true" to a variable called "theStringsMatch" (if a variable by that name doesn't exist yet, then this will also declare a variable by that name). If the two strings are not the same, it instead executes the bottom
Set variable block, which assigns the value "false" to the same variable.
Get variableblock, and the value of that variable is then used as the input to a
Boolean Branchblock, which will determine which of its outputs will be executed. This is an example of controlling the flow of our graph using a boolean variable whose value is not known to the developer when they make the graph, but is instead calculated only once the graph is running.
Note: the values for
Boolean blocks are not case-sensitive, so they work with "true", "True", "false", and "False". If you were to type anything besides those values into the
Boolean block above, then neither of the
Boolean Branch outputs would execute.