Closed jellewie closed 5 years ago
Getting eulerAngles from a Quaternion involves complicated floating point math which will result in slight differences. In your case 1.001791E-05 == 0.00001001791. Not going to be noticable in game, but a bit awkward for the save system.
I will keep this open (since I think I had some that were 91 degrees. if this was indeed true, we need to divide it by 90 and then round, and then multiply again. But if this happens I will report this. else we can mark this solved within a (few) week(s)
(this bug was discovered while testing save/loading worlds https://pastebin.com/G5BWe9tf)
https://answers.unity.com/questions/493616/euler-angle-problem-in-if-check.html
Wooden_Wall_Spiked,-7,-2,-13,1.001791E-05,False,0,100
1.001791E-05 isn't a good angle... it should be 0
Either the convert-code I made is wrong, or we have a floating point error, we should round the stuff to the closest 90 degrees
`
else if (CodeInputManager.GetButtonDownOnce(10)) //If we want to rotate the building {
} `