Stopping/cancel Translate animation

Hey, just a quick question. I am using object:translate to animate my graphics and was wondering what the method is for cancelling them. Having looked at the documentation, I couldn’t find any information for this. 

Basically when I hit an object I want it to drop straight down via transition.to, however as I do this, i notice the objects translate params are still going on which results in my objects moving down diagonally since translate is moving them along X.

Cheers 

Hey dip,

if you call transition.to you, it returns a transition handle, which can be cancelled.

local currentTransition = transition.to(object, {time=500, x=100}) transition.cancel(currentTransition)

Also object:translate is something different. It takes action immediatly (no time involved) and therefor it could not be cancelled.

Hope that helps :slight_smile:

I thought so. I guess I will jump to using transitions again. thanks for clearing that up torbenratzlaff.

Hey dip,

if you call transition.to you, it returns a transition handle, which can be cancelled.

local currentTransition = transition.to(object, {time=500, x=100}) transition.cancel(currentTransition)

Also object:translate is something different. It takes action immediatly (no time involved) and therefor it could not be cancelled.

Hope that helps :slight_smile:

I thought so. I guess I will jump to using transitions again. thanks for clearing that up torbenratzlaff.