what I want to do is delete an object if it touches another object for more than 5 seconds
Develop games in your browser. Powerful, performant & highly capable.
Add timer behaviour to object A and say, object A on collision with object B, start timer. Then have another event 'on timer' destroy object A. And another one to cancel the timer like object A not overlapping object B, stop timer.