So I'm trying to move this unit in a circular motion and everything is working out perfectly fine apart from one thing, the radius keeps increasing by a tiny amount. Over a short span of time this would not be visible - but this is not the case.
This is the code and the formula for the circular motion that I'm using:
This is the code and the formula for the circular motion that I'm using:
JASS:
set u1 = gg_unit_n001_0000
set u2 = udg_UNIT_Dummy[1]
set x1 = GetUnitX(u1)
set y1 = GetUnitY(u1)
set x2 = GetUnitX(u2)-x1
set y2 = GetUnitY(u2)-y1
set d = SquareRoot(y2*y2+x2*x2)
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), R2S(d) )
set a = Atan2(y2,x2)+7.50*bj_DEGTORAD
call SetUnitPosition(u2,x1+d*Cos(a),y1+d*Sin(a))
call DestroyEffect(AddSpecialEffectTarget ("war3mapImported\\BlackKeeperMissileNoSound.mdl", u2, "origin"))
set u1 = null
set u2 = null