Ability to drag gets turned off!

Howdy!

In the game I’m trying to create dragging is enabled on certain objects and works well however if I click on my background then try to move the object nothing happens and I have to click my object again.

Has anyone ever had this problem before, do you need me to post some code?

Let me know and thanks for all your help! :slight_smile: [import]uid: 90223 topic_id: 15857 reply_id: 315857[/import]

Hey, I’m not sure exactly how i was happening but I’ve fixed it by taking out this line:

Runtime:addEventListener("touch", pause)

This is the code the above is linked with:

[code]function pause(event)
if event.phase == “began” then
if paused == false then
physics.pause()
paused = true
elseif paused == true then
physics.start()
paused = false
end
end
end

paused = false
Runtime:addEventListener(“touch”, pause)[/code] [import]uid: 90223 topic_id: 15857 reply_id: 58623[/import]

You have set your eventHandler (Listener) on the Runtime object, which means that any click will act as a toggle.

so here’s a dry run of your paused flag
START paused = false
object -> paused = true
backd -> paused = false
object -> paused = true

so if you find yourself in this situation,

START paused = false
object -> paused = true
backd -> paused = false
ANYWHERE -> paused = true
object -> paused = false
If you cannot move your object, just try again and it will work

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15857 reply_id: 58669[/import]