I see. So if I understand you correctly, the velocity doesn’t matter, and all you want to know is the distance between the object’s current position and its initial position?
In general, the distance between two points (x1,y1) and (x2,y2) is sqrt((x1-x2)^2 + (y1-y2)^2).
So, in your situation, if you store [lua]x[/lua] and [lua]y[/lua] as the starting coordinates of your object, and [lua]obj.x[/lua] and [lua]obj.y[/lua] are the current coordinates of your object, the distance between them would be [lua]math.sqrt((obj.x-x)^2 + (obj.y-y)^2)[/lua].
Hope this helps.
- Andrew [import]uid: 109711 topic_id: 30477 reply_id: 122124[/import]