function alignChar(c)
local p1 = Characters[c].CharacterPosition
local p2 = getCursorPos()
-- + --
local ax, ay
ay = p1.y - p2.y
ax = p2.x - p1.x
-- + --
local angle = math.deg( math.atan2(ay, ax) )
if angle < 0 then angle = 360 + angle end
-- + --
c.CharacterDirection = angle
end
usage...
This is based on the workflow function I shared on the wiki for aligning one character to another. To make it loop you could register the function as a mainLoop when left click & holding over the character, then unregister on release. I think you could probably make this more global with a bit of editing, but it's late & I'm not in the right frame of mind to figure it out.
Rotating objects/animations would also be possible as Simon implemented a rotation data stucture parameter for scene objects so you could do the same thing with that, but scene objects require the rotation in radian instead of degrees. I have no idea why.