# Go.animate rotation.z (SOLVED)

**URL:** <https://forum.defold.com/t/go-animate-rotation-z-solved/18309>\
**Category:** Questions\
**Created:** [March 26, 2018, 11:40pm UTC](https://forum.defold.com/t/go-animate-rotation-z-solved/18309 "2018-03-26T23:40:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gmanicus](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gmanicus/32/10312_2.png) [@Gmanicus](https://forum.defold.com/u/Gmanicus)\
**Post date:** [March 26, 2018, 11:40pm UTC](https://forum.defold.com/t/go-animate-rotation-z-solved/18309/1 "2018-03-26T23:40:39Z")

</div>

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:

```lua
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?

---

<div class="post-metadata">

**Author:** ![Gmanicus](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gmanicus/32/10312_2.png) [@Gmanicus](https://forum.defold.com/u/Gmanicus)\
**Post date:** [March 27, 2018, 2:21am UTC](https://forum.defold.com/t/go-animate-rotation-z-solved/18309/2 "2018-03-27T02:21:53Z")

</div>

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

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

```

This gave me the result I had wanted.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 27, 2018, 7:19am UTC](https://forum.defold.com/t/go-animate-rotation-z-solved/18309/3 "2018-03-27T07:19:45Z")

</div>

I think it’s important to point out that `rotation`is a [Quaternion](https://en.wikipedia.org/wiki/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](https://forum.defold.com/t/rotation-and-direction-problem/18242/3) with a link to a good video presentation about quaternions.

---

<div class="post-metadata">

**Author:** ![Hauger987](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/hauger987/32/35584_2.png) [@Hauger987](https://forum.defold.com/u/Hauger987)\
**Post date:** [May 6, 2024, 5:05pm UTC](https://forum.defold.com/t/go-animate-rotation-z-solved/18309/4 "2024-05-06T17:05:44Z")

</div>

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.
