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.