FuelGaugeArrow:rotate( 75 ) local FuelDecreaseAngle = 150 / FuelLevelMax local function BurnFuel(event) --transition.to( FuelGaugeArrow, { rotation = FuelGaugeArrow.rotation - FuelDecreaseAngle } ) FuelGaugeArrow.rotation = FuelGaugeArrow.rotation - FuelDecreaseAngle FuelLevel = FuelLevel -1 if FuelLevel \<=0 then OutOfFuel() end end local FuelBurn = timer.performWithDelay( 1000, BurnFuel , 0)
The FuelGaugeArrow value is updated by another function (when the rocket picks up a fuel barrel, it increases the value).
This works fine in the code above, but when I use the commented-out code, i.e. when I try to use transition to move the arrow, it only works when there is no transition going on at that precise moment. The updated value is not picked up by the BurnFuel function when transition is in progress.
I’m sure there’s a better way to do this, so please enlighten me.