This behavior was not observed up to UE 4.19, but it can be reproduced in all versions from 4.20 to 5.4.
When a "Literal Enum" node is used inside a blueprint and an enumeration value is chosen from the available dropdown, the output correctly matches the selected value.
However, if the node has any connection to its input pin, the output ignores it and always incorrectly returns the default enum value (index 0).
While this is an odd usage of the node, the Engine allows it, and when it happens the resulting behavior is very difficult to debug, unneccessarily costing user's time. Also, the proposed fix is very quick and straightforward to implement and test: simply treat the node as a "Reroute node" when an input is connected. This can be done by adding the following code to function "UK2Node_EnumLiteral::ExpandNode()" after the first (bSuccess) test:
UEdGraphPin* InputPin = FindPinChecked(GetEnumInputPinName());
if (!InputPin->LinkedTo.IsEmpty())
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-215264 in the post.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 5.4 |
Target Fix | 5.6 |
Created | May 17, 2024 |
---|---|
Updated | Sep 30, 2024 |