Hello!
I wanted to create a tool that rounds my rotation angles to the floats with just 0 after the decimal point (i.e. 85.236987 → 85.0, 83.99654 → 84.0).
I started off collecting my initial rotation numbers and then I rounded them.
After, I SetActorRotation with the numbers I just got.
When I use the bp, I get floats with lots of fractions after the decimal point (i.e 58.9654 → 59.0001).
Is there a way to set rotation numbers in the way I described?
Thank you!
I don’t know why but even direct input of degrees causes that fractions in UE. anyway we are talking about < 1/100,000 degrees error.
if you check the three floats after math the results is ok but the error may be added once you set inside the rotator. try printing the floats and the compound rotator just to check.
That might be the case.
I am just curious if it is even possible to have ‘pretty’ numbers. When I print my floats, they are all as I want them to be. When I set rotations the fractions appear.
You have control over the print and can round or truncate them as necessary. When you’re reading actual float values, float inaccuracy comes into play at all times.
It’s why you never use floats for money. (unless you’re freakin’ Amazon… sigh)