Unity3D UI, calculation for position dragging an item?

I would make your script implement the drag interfaces public class Dragster:MonoBehaviour,IBeginDragHandler, IEndDragHandler, IDragHandler Which will make your DragIt function become public void OnDrag(PointerEventData eventData) { transform.position += (Vector3)eventData.delta; } giving you access to the delta of that event (how much the mouse has moved) to be able to move your object. If you would … Read more