Pause physics with a timer

Hello,

I’m trying to pause the physics engine for a certain period of time when an object is touched. After the period of time has passed, the physics would start again. How would I do this? My touch listener is object-based. Any help would be much appreciated.

Thanks [import]uid: 47722 topic_id: 12642 reply_id: 312642[/import]

[code]

local function tapped()
physics.pause()
timer.performWithDelay(500, function() physics.start() end, 1 ) – change 500 to the time you want (in ms)

[/code] [import]uid: 24641 topic_id: 12642 reply_id: 46277[/import]

Thanks bertybottom…it worked perfectly! I didn’t know I could create a function from within a timer. Thanks again! [import]uid: 47722 topic_id: 12642 reply_id: 46287[/import]