The Negate Blueprint macro returns the original unmodified value – this is neither obvious, nor probably what was intended.
This is the body of the negate macro:
It is evaluating (Value * -1)
, setting Value (by ref) to (Value * -1)
, then returning (Value * -1)
– this is causing the negate to be evaluated twice, so the Result pin will be Value, not (Value * -1)
I.e. this is the same as following C++:
float Negate(float& Value)
{
Value = (Value * -1);
return (Value * -1);
}