So, here's the issue. I took pictures in order to better illustrate it.
In order to provide animation, I have a script that changes the rotation of a gameobject using transform.LocalRotation = Quaternion.Euler(0f,0f, x) , with x being the angle. So far so good.
However, when the parent object has its scale set to a negative number (in order to flip the object), sometimes the visible rotation of the object flat out doesn't match what its Transform says it does.
For instance.
![alt text][1]
( Simplified image for illustrative purposes)
In this picture we see that the object is clearly rotated on the Z axis, but its transform indicates that its rotation is at 0 0 0.
![alt text][2]
I've been debugging it for a while, and this problem started happening once we started using negative scale to flip 2D objects instead of rotating on the Y axis, which seemed tidier.
Yet, when I manually alter the Transform's properties, even if just setting the rotation to 0,0,0, it aligns itself correctly.
I've been racking my brains trying to figure out why this happens and I'm fresh out of ideas. Does anyone know why this could be happening?
[1]: /storage/temp/20490-rotation+bug+report+1.png
[2]: /storage/temp/20491-rotation+bug+report+2.png
↧