Hi,
Is there a way to cancel a drag action, and force the item to move back to its start position, but animated, with dt?
Currently I do this manually, and it is quite a mission.
Tks
Develop games in your browser. Powerful, performant & highly capable.
JACLEMGO I did something along these lines by saving item x/y values on drag start and setting the item location back to those when certain things happen (like collisions or what ever you wish to be the cancel action). Adding animation to that shouldn't be too hard, dont take my word for it though :)
Yeah, just use a variable for the return, and the start positions like:
object variable return =1
object set position to lerp(self.x,startx, 1-0.5^dt), lerp(self.y, starty,1-0.5^dt)
newt Tks, that is exactly what I was looking for!