Make transition run constantly

NOTE= I do not mean iterations=-1

So lets say I have a transition:

transition.to(obj, {time=3000,x=obj2.x-50,y=obj2.y-50})

If obj2 moves(x,y cordinates change), I want the transitioning object to be constantly transitioning to obj2

I have tried setting iterations to -1 and putting the transition code in a loop but it still doesnt work.

Anyone know what to do?

Can’t do it.  That is not how transition.to() works.

You basically want obj2 to always be offset from obj1 by 50 pixels?

Set up an enterframe listener and update the position of obj2 based on the current position of obj.

If you want to lag behind, in enterframe calcalate the distance between them, and move obj2 part of the way depending on how quick/slow you want it to catch up.

This example shows multiple dots following the dot in front of them using enterFrame() listeners.

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/05/followTheLeader.zip

https://www.youtube.com/watch?v=1H4jATyCbew

The leader is moving with transition.to(), but in this example you could think of the red dot as the player and the other dots as enemies following a lead dot (green) which itself is following the player (red).

Can’t do it.  That is not how transition.to() works.

You basically want obj2 to always be offset from obj1 by 50 pixels?

Set up an enterframe listener and update the position of obj2 based on the current position of obj.

If you want to lag behind, in enterframe calcalate the distance between them, and move obj2 part of the way depending on how quick/slow you want it to catch up.

This example shows multiple dots following the dot in front of them using enterFrame() listeners.

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/05/followTheLeader.zip

https://www.youtube.com/watch?v=1H4jATyCbew

The leader is moving with transition.to(), but in this example you could think of the red dot as the player and the other dots as enemies following a lead dot (green) which itself is following the player (red).