Hey all, I have an array Items={} that I use to declare variables and display objects in my scene.
When I leave the scene, I want to make sure I clean up and remove every item in that Items{} array but I need help determining if each item when I iterate through the table is either a display object (image, rectangle, etc.) or just a simple variable and then executing removeSelf() on the display object.
I thought I had seen this somewhere before but I’m struggling locating it.
For example:
for p,v in pairs( Items ) do
if Items[p] IS A DISPLAY OBJECT then <-- what do I check for here??
Items[p]:removeSelf()
end
Items[p]=nil
end