E
Etio
Guest
I wrote this to try and make an object move about a point:
(obj_tether being the point the object should be moving around) It appeared to be working fine, but when I tracked the distance from the object to obj_tether as it moved it was inconsistent, and even worse when it had completed a full revolution it ended up slightly further out than it began.
I can't see any issue with my code, if anyone has any alternatives to it or at least an explanation as to why it isn't working it'd be greatly appreciated.
Code:
spd = 1
dir = point_direction(x,y,obj_tether.x,obj_tether.y)+90
xchange = cos(degtorad(dir))
ychange = sin(degtorad(dir))
x += xchange*spd
y -= ychange*spd
I can't see any issue with my code, if anyone has any alternatives to it or at least an explanation as to why it isn't working it'd be greatly appreciated.