Thanks but I have done all this.
I kind of coded oddly, an object spawns when they touch screen. Then when they release , they toss and when that object collides with another object- both objects are destroyed- removed - set to nil.
So I have an event listener for spawn object that occurs on touch. The touch function then has an event listener called within that which listens for that object to collide.
I create a table in scene:created. This table has values added to it when object spawns , and within the spawn object function, when touch is released- another listener occurs for that object in table to listen when it collided.
Ultimately , the only major runtime event listener is the SpawnObject when the user initially touches the screen- which I remove when scene is destroyed.
The collisioner listener is embedded in that which is directed to that particular table object.
It’s probably a terrible way of coding but I’m just starting out. Im a little reluctant to post code here since there’s more to it then that. I suppose I could just post the ‘objectSpawn’ touch event listener since it’s probably the one that’s giving issue during cleanup.
But all that is in the ‘scene:created’ composer function, which should be deleted when it’s removed and re-launched when scene changes back?
And I’ve checked a hundred times. On collision - my table reference object gets deleted and set to nil- along with the object it collides with.
I’ll re-examine the code tonight, If I still can’t figure it out I’ll post it to the Composer forums.
I been at this for several days now!
I should also note that since I’m spawning objects on touch - I’m creating the physicsBody on touch - because whenever the user touches the screen - it’ll keep spawning objects. So I created a local table (not in any function) and when the user touches screen - it adds a reference to the table to store the object then creates the physics body for that particular spawned object.