I have created an object that I want only my game ball to pass through.
event.contact.isEnabled = false works if I don’t delete the object the ball is passing through. However I need the object to be deleted after the collision has ended. This has been causing some weird issues where the collisions aren’t reacting as I want.
local function preCollision( self, event ) local other = event.other if other.name == "ball" then event.contact.isEnabled = false local function deleteListener() display.remove( self ) self = nil end timer.performWithDelay( 40, deleteListener ) end end
I just need the object to act like a sensor for only the ball then delete after the collision.
Thank you again,
Jarrod