function update (self, dt)
local rot = go.get_rotation()
rot.z = rot.z + 1
go.set_rotation(rot)
end
But it makes my object scale up oddly
Everything I have seen before about rotation aims to set a deremined rotation with an angle but I need to define a relative rotation on every frame, I found nothing about the deeper behavior of the rotation system.
I would recommend to use quaternions as in @sergey.lerg example. Some additional comments:
In your example you’re rotating by 1 per frame/update. You should instead define a number of degrees to rotate per second and multiply that by dt (delta time) to get an even rotation regardless of fps or any lag.
For constant rotations it’s recommended to use go.animate instead of running Lua code every frame.