I have been struggling during my last couple of coding sessions with a strange behavior I have discovered (Defold -1.2.81).
In a nutshell, when animating the euler property on the z-axis, if you go over 90 deg. (using go.animate) and apply any other animation (such a going back to 0 deg.), the rotation applied will be the opposite of what would be expected.
I would expect this kind of behaviour when going 180 deg. not 90.
I’ve bundled together a test collection in a debug project that you can easily reproduce this. Please find it here:
It’s also interesting to notice that when using go.get() to retrieve the current value of “euler.z”, it gives strange result and visuals when the game object is over 90 and less than it’s final rotation value.
the github link provided points to a defold project that showcases this issue.
Or It can be reproduced quite easily by applying to a game object the following:
I believe this issue is a duplicate of DEF-1636. Might be good to flag it.
Do you have any update regarding this by the way?
I’m still hoping I could use euler rotation at some point
I too wonder this, I’m not sure I’m hitting this bug or not but I’m trying to rotate stuff by animating euler.z and I have unexpected behaviour when going past 90 degrees.
Animating the “rotation” property animates the rotation quaternion linearly with no normalization. This will cause all sorts of artifacts like scaling. You should use vmath.slerp().
Sorry if I should have made another forum topic. I’ve seen lots of messages about this but none of them helped. I can understand if it’s a bit more complex than just using that snippet of code above.