Convert positive float to negative?

Hello :slight_smile: How can I convert a positive float to a negative float in C#?

Thanks, Andreas :slight_smile:

x = -Mathf.Abs(x);

x = -x;

Do you remember this from school?

1*1=1
-1*-1=1 
1*-1=-1
-1*1=-1

Mathf.Abs for absolute value also works on a variable.

x = 10;

print(-x);

prints: “-10”