In transform.Rotate, I can't use a decimal, an alternative?

In transform.Rotate, I cannot use decimals, I want to rotate something by 1.5. Are there any alternatives to it, for even ways to use decimals in transform.Rotate?

For decimals, you need to put an “f” after it, so the compiler knows that it’s a float.

transform.Rotate(0f, 1.5f, 0f);
1 Like

Additionally, even when you’re writing whole numbers where it expects a float you should still put an “f”. Otherwise the number is an integer type and implicitly converted to a float instead of just starting life as a float.

When you have a number with a decimal point without an “f” it is treated as type “double”, and it only didn’t work because there is no implicit conversion from double to float.

1 Like

Thanks for helping me out!