Boolean. to stop other transitions from working

freeToMove = true local check = function(freeToMove) freeToMove = true end local Movement = function() if freeToMove then freeToMove = false transition.to( man, { time=speed, x=(l[c].x), onComplete=check(freeToMove) } ) end end

Trying to make a boolean that will stop other transitions from working, whilst one is in the process of moving.

this transition will only work once…

Hi @iansingleton39,

  1. You use two different variables with the same name ‘freeToMove’ One is global and second is local (in check function).

  2. Wrong argument in transition. For onComplete parameter you need to provide function name but instead that you call function.

Try

freeToMove = true local check = function()      freeToMove = true end local Movement = function()          if freeToMove then                    freeToMove = false          transition.to( man, { time=speed, x=(l[c].x), onComplete=check } )      end end

Read more:

Have a nice day:)

ldurniat

Thanks for you time and help… I can now learn from this and move on to my next battle.

Hi @iansingleton39,

  1. You use two different variables with the same name ‘freeToMove’ One is global and second is local (in check function).

  2. Wrong argument in transition. For onComplete parameter you need to provide function name but instead that you call function.

Try

freeToMove = true local check = function()      freeToMove = true end local Movement = function()          if freeToMove then                    freeToMove = false          transition.to( man, { time=speed, x=(l[c].x), onComplete=check } )      end end

Read more:

Have a nice day:)

ldurniat

Thanks for you time and help… I can now learn from this and move on to my next battle.