Arithmetic operators

The arithmetic operators (+, -, *, and /) can be used to create mathematical expressions in Blueprints. The following screenshot shows the equivalent nodes in Blueprints. These operators receive two input values on the left and give the operation result on the right. The + and * operators can have more than two input parameters; just click on the Add pin button on the node to add another input parameter. The input values can be obtained from a data wire or entered directly in the node:

The * symbol is the multiplication operator in programming languages. Blueprints also recognize * as the multiplication operator but use the letter X as the label of the multiplication node. You need to use the * symbol when searching for multiplication nodes in the Context Menu.

The following screenshot shows a simple arithmetic expression. The numbers on the screenshot show the order of execution of the nodes. The execution starts with Event BeginPlay. The SET node assigns a new value to the Magic Points variable, but this value must be obtained using the data wire that is connected to the output of a multiplication node, which will need to get the value of the Willpower variable using another data wire to multiply by 20.0:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset