Hi! i want to implement rotation of an object to another object
I use this script
local myPos;
local targetPos;
function init(self)
myPos = go.get_position(hash("/go2"))
targetPos = go.get_position(hash("/go1"))
local dir = vmath.normalize(myPos - targetPos);
local angle = math.deg(math.atan2(dir.x,dir.y))-90
go.set("/go2","euler.z",angle)
print(angle)
end
and it works, but not quite
on unity it works