Pick up an object with the mouse in 2D
I need a script that lets you grab a puzzle piece object with a click and pin it to the mouse. One click and the object is pinned to the mouse. You don't have to hold it down. You just move it around, and then click again to put it down. A right-click, when holding the object, should rotate the object by 90 degrees on the Z axis.
I also need the object, when placed down, to be constrained to grid coordinates, so that when you drop it, it snaps to 1.0, 2.0, 3.0, etc. Not 1.56667 or anything.
Thanks in advance for your help.
Your answer

Follow this Question
Related Questions
Issues with dropping an object on multiple objects separetly - Simple 2d Drag & Drop 0 Answers
2D Character movement using OnDrag 0 Answers
Drag and Drop Problem 0 Answers
Moveable Button that resets when click is over 0 Answers
Unity Drag and Drop game 2 Answers