unity 2d drag & drop

Hi Every one
I Instantiated one gameobject named “Food” and I want to drag it on other gameobjects named such as “Chicken”. after the mouse is UP the Food will be destroyed.
Thank you for your help.

Hi, there is a component called “Event trigger”, it allows to call functions of a script if an event has been triggered. And there are the Drag, Drop, Begin Drag and End Drag events which can be useful in your case.

To create a drag effect make sure you call a function in your Drag event that does :

transform.position = Input.mousePosition.

I hope it will help you.