Go.animate rotation.z (SOLVED)

I’m trying to rotate objects using go.animate, and yet when I use it, the objects enlarge or shrink depending on the degrees inputted. This is what I thought would work:

go.animate("wheel2", "rotation.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/speed)

I found out that it requires quaternions to rotate an object, which I don’t know how to calculate for. Would someone mind helping me out?

I solved by problem by instead using the euler.z property, which was mentioned in some similar topics.

go.animate("wheel2", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/speed)

This gave me the result I had wanted.

I think it’s important to point out that rotationis a Quaternion, it is not euler angles. As you figured out, those are named euler. This confusion isn’t uncommon, and I posted a small reply here with a link to a good video presentation about quaternions.

5 Likes

Thank you so much for posting and solving this, haha… if I had managed to find this post a week ago my life would have been much easier. But yes, for anyone wondering, this still works; just bear in mind that “euler.z” is a go property, not a sprite property.