Hello, dear Defold community! I have a question. I want to rotate GO towards the mouse in function go.animate
I’ve made some research and found the solution how to rotate GO
local mouse_position = vmath.vector3(action.x, action.y, 0)
local object_position = go.get_position()
local direction = mouse_position - object_position
local angle = vmath.quat_rotation_z(math.atan2(direction.y, direction.x))
go.set_rotation(angle)
It works perfectly
but I don’t want to use go.set_rotation(angle)
I want to use go.animate and there are I have some problems