How to make object follow another object?

I read a 2010 post in which someone asked how it was possible to have an object that followed another object.

I had the same problem and I solved it in a very simple way.

I’ll bring it back here because maybe it could be useful to someone:

... local function followObject() transition.to(MyObj,{y=objToFollow.y, time=difficulty, transition=easing.outQuad, onComplete=folowObject}) end

where ‘difficulty’ is a var: lower is very similar to obj to folow, higher less.

transition with high values (200 -500) can emulate  indecisions. You have to try.

Is very fast end very corona oriented because works by events.

Renato