Node Copied to Clipboard!

Editor Documentation - Nodes


Operators

Is Equal

The Is Equal is a binary operator that takes two arguments and compares whether they are equal or not (True or False). The resulting boolean will be passed through the bottom handle of this node.

Right-click on storyboard to add the Is Equal node under Operators.

Open at least two argument slots. Usually it is used to compare some variable value and a constant value of the same type. For example, you can compare the value of an integer variable with a constant integer or an object property against a boolean. You can compare more than two arguments as well.

Is Equal pairs well with If and Branch nodes. In This example the lesson will only animate and unhighlight the sphere only if the sphere was highlighted before. Therefore we won't be trying to unhighlight an object that was never highlighted to begin with.

Is Equal is often used to create arguments for the And and Or operators also discussed in this article.

Is Not Equal

As seen above we can use Is Equal to compare if values are equal to each other. To check if values are unequal we can use the Is Not Equal node.

This node can be used the same way as Is Equal but it returns True if the values are not equal and False if they are.

Not

Not can be attached to the bottom of binary operators such as Is Greater Than or Is Less Than as well as the And and Or nodes to obtain the opposite return value to the one expected.

For Example using it with Is Less Than converts it to Is Not Less Than. Therefore if The Is Less Than node would have normally produced a False because the first argument was greater than the second then adding a Not would convert the False to a True and we can play an instance that counts on the variable being greater than and not less than.

In this example with nothing originally highlighted the sphere will highlight only if the variable named num is not less than 0 and highlight the box if it is less than 0.

And

The And node will return True only if all of its arguments result to True.

You must provide at least two arguments with boolean results.

The example above uses two Is Equal Nodes as arguments. If both the red and white wires are visible then the lesson will play the True branch. If one or both of the wires is not visible then it will play the False branch.

Or

Using the exact same example as the And node but replacing the And with the Or node yeilds a different result. Now, the True branch will play when both wires and even if just one wire is visible and play the False branch only when both wires are not visible.

Is Less Than

Takes two arguments and returns True if the first argument is less than the second argument and False otherwise.

The example above will highlight the sphere if the variable num is less than 0 and highlight the box if it is greater than or equal to 0.

Is Greater Than

Takes two arguments and returns True if the first argument is greater than the second argument and False otherwise.

The example above will highlight the sphere if the variable num is greater than 0 and highlight the box if it is not.

Is Greater Than Or Equal

This node works the same as the Is Greater Than node except it returns true if the first argument is greater than or equal to the second and False if it is less than it.

Is Less Than Or Equal

This node works the same as the Is Less Than node except it returns true if the first argument is less than or equal to the second and False if it is greater than it.

Divide

The Divide node will divide the first argument by the second argument. If there is more than two arguments it will take the result of the division and divide it by the next argument below.

In this example, it will do 10/2 = 5 and then 5/2 = 2. Note: because we are using the int type it will perform integer division (how many times 2 can fully go into 5) with no decimal places. If you use the float type you will get the expected decimal answer.

Modulo

The Modulo operator gives the remainder of a division.

For Example, 5 modulo 2 = 1 because 2 goes into 5 evenly 2 times and leaves one left over.

Multiply

The Multiply node works as you would expect by multiplying all of its arguments together. It takes at least 2 arguments.

Add

The Add node will add together all the arguments you give it. It takes at least 2 arguments.