Proble with ending transition using tag names

I’m using a tag to cancel some transitions, but noticed the canceling is not working every time. It looks like from time to time it is not stopping the transition and now I wonder if this is a known issue or if I’m missing something here. I’m using Corona 2666

Hi @c.noeth,

I’ve never heard of an issue with transition tags not working. You may need to post some code that exhibits this issue.

Thanks,

Brent

Here is a sample based on the code:

local rot1,rot2 rot1 = function(subobj1) transitionStash[#transitionStash+1]=transition.to(subobj1,{time=4000,rotation=subobj1.rotation+360,tag="tire",onComplete=function() rot1(subobj1) end}) end rot2 = function(subobj2) transitionStash[#transitionStash+1]=transition.to(subobj2,{time=4000,rotation=subobj2.rotation+360,tag="tire",onComplete=function() rot2(subobj2) end}) end rot1(animpart1) rot2(animpart2) transitionStash[#transitionStash+1]=transition.to(objgroup,{time=2000,delay=2000,x=\_W\*0.5,transition=easing.outQuad,onComplete=function() transition.cancel("tire");\_G.buttonsactive=1 end})

Hi @c.noeth,

This may be caused by the fact that you’re re-calling (re-starting) transitions with the onComplete event. If you want to rotate these objects “endlessly”, why not just set the “iterations” value to something really high like 1000 or even 10000? No user would likely watch it long enough to see it rotate 10000 times. :slight_smile:

Brent

Thx for your fast help Brent!

We support infinite iterations already. If you want something to rotate endlessly, use this:

transition.to( MY_OBJECT, { time = TIME_TO_ROTATE, iterations = -1, delta = true, rotation = 360 } )

Hey great! Thank you for the info. This makes things a lot more easy :wink:

Hi @c.noeth,

I’ve never heard of an issue with transition tags not working. You may need to post some code that exhibits this issue.

Thanks,

Brent

Here is a sample based on the code:

local rot1,rot2 rot1 = function(subobj1) transitionStash[#transitionStash+1]=transition.to(subobj1,{time=4000,rotation=subobj1.rotation+360,tag="tire",onComplete=function() rot1(subobj1) end}) end rot2 = function(subobj2) transitionStash[#transitionStash+1]=transition.to(subobj2,{time=4000,rotation=subobj2.rotation+360,tag="tire",onComplete=function() rot2(subobj2) end}) end rot1(animpart1) rot2(animpart2) transitionStash[#transitionStash+1]=transition.to(objgroup,{time=2000,delay=2000,x=\_W\*0.5,transition=easing.outQuad,onComplete=function() transition.cancel("tire");\_G.buttonsactive=1 end})

Hi @c.noeth,

This may be caused by the fact that you’re re-calling (re-starting) transitions with the onComplete event. If you want to rotate these objects “endlessly”, why not just set the “iterations” value to something really high like 1000 or even 10000? No user would likely watch it long enough to see it rotate 10000 times. :slight_smile:

Brent

Thx for your fast help Brent!

We support infinite iterations already. If you want something to rotate endlessly, use this:

transition.to( MY_OBJECT, { time = TIME_TO_ROTATE, iterations = -1, delta = true, rotation = 360 } )

Hey great! Thank you for the info. This makes things a lot more easy :wink: