self.chimp_node = gui.get_node("chimp")
...
if action.released and gui.pick_node(self.chimp_node, action.x, action.y) then
gui.cancel_animation(self.chimp_node, "rotation.z")
gui.set_rotation(self.chimp_node, self.chimp_rotation)
gui.animate(self.chimp_node, "rotation.z", 360, gui.EASING_OUTEXPO, 1, 0, function()
gui.set_rotation(self.chimp_node, self.chimp_rotation)
print("animation done")
end)
end
This works, but if you do not restore the rotation to the original value before trying to animate it again it does nothing when attempting to do more spins. Probably because it’s already at 360. But this may confuse someone else at first in the future so posting here so it can be searched.
I get what you are saying but modifying the rotation is not treated differently from other properties. We do nothing to keep the rotation within 0 and 359 degrees. If you want to spin something another 360 degrees you need to add to the existing rotation. Something like this: