{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Select Node in Unreal Engine 5 C++UE Docs

The Blueprint Select node picks a value based on a condition, which in C++ is the ternary operator: int32 Result = bCondition ? OptionA : OptionB;.

Blueprint node & C++ equivalent

C++
// Blueprint "Select" = ternary
int32 Result = bCondition ? OptionA : OptionB;

What does the Select node do?

The Select node returns one of several input values based on an index or boolean, without changing execution flow. With a boolean condition it simply chooses between two options, making it a pure data node rather than a branch on the execution wire.

The C++ equivalent

For the two-option boolean case, use the ternary operator: int32 Result = bCondition ? OptionA : OptionB;. When bCondition is true the expression evaluates to OptionA, otherwise OptionB. This is an expression, not a statement, so it returns a value you can assign directly, exactly like the Select node's output pin.

When to use it

Reach for the ternary when you only need to pick a value, not run different code. If you have more than two options or an integer index, a switch or a small lookup array reads more cleanly than nested ternaries. Keep both branches the same type so the result type is unambiguous.

Frequently asked questions

What is the C++ equivalent of the Blueprint Select node?+

The ternary operator. A boolean Select becomes Result = bCondition ? OptionA : OptionB;, which returns one of the two values based on the condition.

Is Blueprint Select the same as a Branch in C++?+

No. Branch changes execution flow and maps to if/else, while Select only chooses a value and maps to the ternary operator without altering which code runs.

Related Flow Control nodes

View all Flow Control nodes →