I’m wondering how the sign node is called in math expressions nodes. I know that there are alternatives (like a/abs(a) in case a != 0), but I’d really prefer to use the sign(a) command instead.
I’ve tried both, sign(a), and SignOfFloat(a), but none of those works.
So, how do I get the sign of a float within a math expression node?
I am well aware that there’s a sign (float) blueprint node and there are conditional nodes. However that was not my question. I was asking if, and if yes, how one can get the sign of a value within a math expression, ideally by syntax that expands to only a single node. Maybe I should rephrase the question a bit: How is the Sign (float) node called in math expressions?
The documentation tells all, seems like you will have to use .
No way to get the sign.
The documentation does state the following though: “Blueprint pure functions that are in a coded function library should all be available.” (quote from the page you linked to). And guess what? class ENGINE_API UKismetMathLibrary : public UBlueprintFunctionLibrary
has a function UFUNCTION(BlueprintPure, meta=(DisplayName = "Sign (float)"), Category="Math|Float") static float SignOfFloat(float A);
.
I’m rather certain it would just work in math expression if it wouldn’t have the DisplayName meta specifier…