Download

Vector multiplication is ignoring sign?

I noticed some weird behavior when I was playing with gravity scale so I decided to add in some debug messages.


GEngine->AddOnScreenDebugMessage(2, .1, FColor::Red, FString::SanitizeFloat(GravityScale));
		GEngine->AddOnScreenDebugMessage(1, .1, FColor::Blue, (Grav * GravityScale).ToString());

case 1: Gravity scale is 1.0, Gravity is 0, 0, -980
case 2: Gravity scale is -1.0, Gravity is -0, -0, -980
case 3: Gravity scale is 5.0, Gravity is 0, 0, -24500

Anyone know what is going on here?

I can fix it by multiplying the x, Y , and Z individually, but I feel like I shouldn’t have to.