If i am removing an enemy from a table do I need to nil him out after remove like so
[lua]for i=1, #onScreenFish do
if onScreenFish[i].canRemove == true then
onScreenFish[i]:removeSelf()
table.remove(onScreenFish, i)
onScreenFish[i] = nil
fishCounter=fishCounter-1
spawnNewFish()
break
end
end[/lua]
or just leave it out
[lua]for i=1, #onScreenFish do
if onScreenFish[i].canRemove == true then
onScreenFish[i]:removeSelf()
table.remove(onScreenFish, i)
–REMOVED HERE–
fishCounter=fishCounter-1
spawnNewFish()
break
end
end[/lua]
I’ve been using the top method and some times my enemies, which use translate to move, just stop. I’m assuming it’s because another has been removed and it is interfering.
Any help would be appreciated.
Cheers [import]uid: 26289 topic_id: 21288 reply_id: 321288[/import]