-If I play the level once, everything works fine.
-If I restart the level multiple times but do NOT change the scene, everything works fine.
-If I change scene back and forth but do NOT restart the level, everything works fine.
-ONLY IF I change scenes AND THEN try to restart the level do I get "attempt to index local 'bounds' (a nil value)
It comes from the line of code that tries to call the function to get the bounds of the enemy box.
So without posting hundreds of lines of code.... is there something I can try to figure out what is going on?
The object itself that I am passing to the function is not nil, it seems that only the contentBounds table is nil.
But what I do not understand is why does this only happen in the one situation mentioned above?
Is there something regarding contentBounds and switching composer scenes that I need to be aware of?
When I switch scenes I am composer.removeScene on the level scene to make sure things get recreated properly when I go back to the scene. Like I said, this works fine as long as I don't try to restart the level after changing scenes.