To create a Math Expression node, Right-click in the graph and select Add Math Expression... from the context menu.

The Math Expression node acts like a collapsed graph. It is a single node that you can Double-click to open the sub-graph that makes up its functionality. Initially, the name/expression is blank. Whenever you rename the node, then the new expression is parsed and a new sub-graph is generated.
To rename the node and update the sub-graph, Right-click on the node and select Rename.
For example, you could rename the Math Expression node with the following expression:
(1+x)*sin(myVar)-2.4/rand()
This would update the Math Expression node to have two float inputs, X and MyVar, and one float output.

If you Double-click the node with this expression, you would see the below sub-graph:

The sub-graph is created by following the below rules:
- Alphabetic names (tokens beginning with a letter) should be turned into either variables, input pins on the Math Expression node, or function calls. From the example above: x, sin, myVar, and rand.
- If an alphabetic name matches an existing variable in the Blueprint, then it will become a variable get node (i.e. if the Blueprint already had a myVar variable).
- If an alphabetic name is followed by an open parenthesis, like sin( and rand(, then it will be turned into a function node.
- If the previous two states are not met, then the alphabetic name is turned into a float input on the Math Expression node.
- The name will also be used as an input if it matches the name of an existing pin on the node.
- Numerical constants are always turned into pin inputs. They never create a node themselves, but instead are used to fill out input fields on other nodes.
- Mathematical operators (like +, *, -) are turned into function nodes.
- Like in mathematics, expressions inside of parentheses will take precedence, and be evaluated first.
Math Expression (수학 표현식) 노드를 만들려면, 그래프에 우클릭하여 뜨는 컨텍스트 메뉴에서 Add Math Expression... (수학 표현식 추가)를 선택합니다.

수학 표현식 노드는 접힌 그래프처럼 작동합니다. 하나의 노드처럼 보이지만 더블클릭하면 그 함수성을 이루는 서브 그래프가 열립니다. 초기에는 이름/표현식이 비어있습니다. 노드 이름을 변경할 때마다 새로운 표현식 파싱을 통해 서브 그래프가 새로 생성됩니다.
노드 이름 변경 및 서브 그래프 업데이트를 위해서는, 노드에 우클릭한 다음 이름변경 을 선택하면 됩니다.
예를 들어 수학 표현식 노드 이름을 다음의 수식으로 변경 가능합니다:
(1+x)*sin(myVar)-2.4/rand()
그러면 수학 표현식 노드가 업데이트되어 X 와 MyVar, 두 개의 플로트 입력과 하나의 플로트 출력이 생깁니다.

이 표현식이 있는 노드를 더블클릭하면, 다음과 같은 서브 그래프가 보입니다:

서브 그래프는 다음 규칙에 따라 생성됩니다:
- 알파벳 이름(글자로 시작하는 토큰)은 변수, 수학 표현식 노드의 입력 핀, 함수 호출 중 하나로 변환될 것입니다. 위 예제에서는 x, sin, myVar, rand 입니다.
- 알파벳 이름이 블루프린트에 있는 기존 변수와 일치하는 (즉 블루프린트에 이미 myVar 변수가 있는) 경우, 변수 Get 노드가 됩니다.
- 알파벳 이름 뒤에 sin( 나 rand( 처럼 괄호 열림이 따라붙는 경우, 함수 노드로 변환됩니다.
- 이전의 두 상태가 일치되지 않는 경우, 알파벳 이름은 수학 표현식 노드의 플로트 입력으로 변환됩니다.
- 이름이 노드의 기존 핀 이름과 일치하는 경우 입력으로 사용되기도 합니다.
- 숫자 상수는 항상 핀 입력으로 변환됩니다. 절대 노드 자체를 생성하는 일은 없는 대신, 다른 노드의 입력 칸을 채우는 데 사용됩니다.
- 수식 연산자(+, *, - 따위)는 함수 노드로 변환됩니다.
- 수학에서와 마찬가지로 괄호 안에 있는 식이 우선권을 지녀 먼저 계산됩니다.
변수
변수 이름은 꽤나 유연하게 지을 수 있지만, 다음과 같은 부분을 기억하는 것이 중요합니다:
- 변수 이름에 숫자가 있을 수는 있지만, 숫자로 시작해서는 안됩니다.
- 변수 이름이 숨겨진 블루프린트 변수 이름과 같을 수는 없습니다.
- 올바른 변수 유형으로 작업중인지 확인하세요. 예를 들어 boolVar+1.5 는 유효하지 않은 식입니다.
연산자 순서
연산자의 연산 순서는 다음과 같습니다 (우선권 순):
- 괄호
- 팩토리얼
- 지수
- 곱하기와 나누기
- 더하기와 빼기
사용가능한 블루프린트 함수
코딩된 함수 라이브러리에 있는 블루프린트 퓨어 함수는 모두 사용 가능합니다. 그 예로는:
- 삼각 함수 (sin/cos/tan, asin, acos, 등):
sin(x)
- 제한 함수 (min, max, clamp, 등):
clamp(y,0,20)
- 소수점 관련 함수 (floor, fceil, round, 등):
round(z)
- 지수 함수 (square, power, sqrt, loge, e/exp, 등)
일부 함수는 흔히 여러가지 이름으로 사용되기도 합니다. 그에 대한 배려로, 같은 함수/노드에 매핑되는 별명이 몇 가지 있습니다. 몇 가지 예를 들면:
- Power (제곱) 별명: power, pow
- 삼각 역함수 (asin/arcsin, acos/arccos, 등)
핀 연결이 아닌 함수 입력을 하기 때문에, 수치와 파라미터 유형을 올바르게 입력했는지 확인해 주시기 바랍니다. 일치되지 않는 경우 수학 표현식 노드에 오류가 표시됩니다.
기본 구조체 유형
수학에서도 꽤나 자주 사용하는 기본적인 구조체가 몇 가지 있습니다. 벡터, 트랜스폼 등이죠. 표현식에서 이러한 유형을 만들거나 관련 연산을 쉽게 할 수 있습니다.
- vector 키워드는 MakeVector 노드를 만듭니다:
vector(x,y,z)
- rotator 키워드는 MakeRotator 노드를 만듭니다:
rotator(x,y,z)
- transform 키워드는 MakeTransform 노드를 만듭니다:
transform(vec(x,y,z), rot(p,y,r), vec(6,5,4))
일부 함수에 대해 별명이 있는 것처럼, 벡터와 로테이터에도 별명이 있습니다.
- Vector 별명
vector, vec, vect
- Rotator 별명
rotator, rot
지원 연산자
다음 연산자 모두 지원될 것이며, 논리 연산자와 비교 연산자를 결합하여 복잡한 수식을 만들 수 있습니다.
- 곱하기식:
*, /, %
- 더하기식:
+, -
- 관계식:
<, >, <=, >=
- 균등:
==, !=
- 논리식:
||, &&, ^
미지원 연산자
현재 지원되지 않는 연산자는 다음과 같습니다.
- 조건식:
?:
- 비트연산자:
|, &, <<, >>
- 단항 접두연산자:
+, -, ++, --, ~, !, 등
- 접미연산자:
++, --, [], etc.