Hello,
Does anyone know how I remove a specific object, that spawns every 0.2 seconds after transition?
local function spawnRings()
local ringNr = math.random(1, 5)
ring = display.newImage("ring"..ringNr..".png", ball.x - ringVar, ball.y - ringVar)
worldGroup:insert(2, ring)
ring:setReferencePoint(display.CenterReferencePoint)
ring.xScale = ballSize/120
ring.yScale = ballSize/120
transition.to(ring, { time=800, xScale=ring.xScale\*2, yScale=ring.yScale\*2, alpha=0 })
end
local spawnRingsTimer = performAfterDelay(0.2, spawnRings, 0, true)
I’ve tried using this function:
local function destroyObj(obj)
obj:removeSelf()
obj = nil
end
and call it once the transition is done, but it just makes the game freeze…
Thanks in advance, [import]uid: 14018 topic_id: 9674 reply_id: 309674[/import]
[import]uid: 14018 topic_id: 9674 reply_id: 35242[/import]