How to animate gui box rotation (Solved)

i’m trying to rotate my sprite like this

gui.animate(self.my_box, “rotation”, vmath.quat_rotation_z(math.pi * 2), gui.EASING_OUTBACK, Config.ANIMATION.MOVE_TO_GOAL_TIME)

and i’m getting this error

ERROR:SCRIPT: level/gui/moving_dice.gui_script:60: bad argument #3 to 'animate' (vector4 expected, got userdata)
stack traceback:
	[C]: in function 'animate'
	level/gui/moving_dice.gui_script:60: in function 'move_dice'
	level/gui/moving_dice.gui_script:71: in function <level/gui/moving_dice.gui_script:63>
but i'm getting this error

I also tried just specify plain float value in this case rotation was wrong.

gui.animate(self.dice, “rotation.z”, math.pi * 2

1 Like

rotation in gui is vector3

2 Likes

actually i need to specify radius in degree…

gui.animate(self.dice, “rotation.z”, 360,…)

1 Like