transform.rotation.y = ((250.0GameControl.BatteryPower/GameControl.BatteryMax)); // Line 1
print(transform.rotation.y); // Line 2
print((250.0GameControl.BatteryPower/GameControl.BatteryMax)); // Line 3
I am rotation a 3d needle to show battery power in a game I’m working on, but the needle will not rotate, and though after Line 1, the two things should be equal, Line 2 always outputs ‘1’ while Line 2 outputs a value between 0 and 250 (as it should). Note that I’ve also tried multiplying by Deg2Rad so that it’s in radians, but this also only changes Line 2, transform.rotation.y is always 1. Does anyone have any idea what could cause this?
Thanks for any help!
Thordis