Dragging and Dropping an Object to the Proper Location on the Screen

Hello, 

I’m working on an app where i need the user to pick an item from the button of the screen (yellow color), drag and drop it to it’s proper location marked with white. 

There should be gravity, and physics so that if the object is not placed in the right location it will fall to the bottom of the screen. 

However, once the object is moved to the right location, it will stay there.

I appreciate if someone could help, give me a hint, or even provide a sample code that I can start with.

Thanks,

Ebrahim

You could update the objects location every .1 of a second when it is touch to the touch position. Also their is a drag and drop example in the corona sample projects.

Best Regards, Tyler Jacobson

First topic that I faced up with on Google.

https://forums.coronalabs.com/topic/38420-how-to-make-physics-object-draggable/

After checking the position of the “dropped” object, you can remove the physics body or set gravity to 0 to prevent it from falling down.

You could update the objects location every .1 of a second when it is touch to the touch position. Also their is a drag and drop example in the corona sample projects.

Best Regards, Tyler Jacobson

First topic that I faced up with on Google.

https://forums.coronalabs.com/topic/38420-how-to-make-physics-object-draggable/

After checking the position of the “dropped” object, you can remove the physics body or set gravity to 0 to prevent it from falling down.