Negate blueprint macro returns original value

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:

107863-pasted+image+at+2016_09_20+10_30+am.png

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);
}

Hello,

I have reproduced your issue and have entered a bug report, which you can track here: Unreal Engine Issues and Bug Tracker (UE-36242)

Thank you for your report.

Have a great day