Hi,
I defined a function for one of my tables as:
NetObject.Disable = function (self) timer.performWithDelay(50, function() self.x = 50 end, 1) end
Nothing fancy, right? just change it’s position so I can confirm it’s working.
Then later on, I set collision handler of that object as:
local function onNetObjectCollision(self, event) transition.to (self, {time=1000, alpha=0.20, xScale=3.5, yScale=3.5, transition=easing.inOutQuad, onComplete = self:Disable() } ) --narm removeThisFoodObjectFromTheWholeGameProperly(event.other) end
Problem is that, transition.to calls the onComplete call back function before actually completing it’s job, which was to change alpha to .2 and increase scale in span of 1000ms.
So in other words, instead of first changing alpha and scaling, it first moves the object then starts to do the alpha and scale jobs.
What am I missing here?
Thanks.