Logic
Last updated 06.06.2020
This page lists all the standard evaluatables that are under the ‘Logic’ category.
And boolean
Takes two input booleans and outputs true
only if both these inputs are also true
.
Boolean Change Detector boolean
Watches an input boolean evaluatable and outputs true
on a frame if the value of the child is different than it was last frame. Otherwise it outputs false
.
Can also be configured to only output when the new value of the input is true
or the new value is false
.
Boolean Constant boolean
Outputs a boolean of your choice, either true
or false
.
Flip-flop (Set-Reset) boolean
A special kind of evaluatable that can store and toggle a boolean value.
It has two boolean inputs, a “Set” and “Reset”.
When Set becomes true
, the flip-flop starts outputting a true
value. It will keep outputting true
until Reset becomes true (even if Set becomes false in the mean time).
Set | Reset | Output |
---|---|---|
0 | 0 | no change |
1 | 0 | 1 |
0 | 1 | 0 |
1 | 1 | 1 |
This can be used to make simple toggles. For example, you could have a layer whose enabled property is based on a flip-flop whose Set was bound to the user pressing the ‘A’ key and Reset bound to the user pressing the ‘Space’ key. Now, whenever the A key is tapped or held, the layer will activate and remain activate until the space key is pressed or held.
Flip-flop (Toggle) boolean
A expression that stores a boolean value and outputs it. Each frame, the value of the input evaluatable is evaluated and if the result is true, the stored value of the flip-flop changes from true
to false
or vice-versa.
If - Else If - Else booleannumberstring
Not boolean
Takes a boolean and outputs the opposite value.
Or boolean
Takes two booleans and outputs true
if either or both of them are also true
.
True Extender boolean
Extends the length of a true
signal from the input boolean by the amount specified in the expression’s UI.
Note that the timer starts as soon as the input becomes false
. So, if the input was true
for 1 second and the duration was 3 seconds, the length of the output true
would be effectively 4 seconds.
This is commonly used for extending the length of a single-frame output such as the numeric change detector.
For delaying a bool signal (without changing its length), see the delay expression.