public void OnDrag(PointerEventData eventData) { //Todo - Add mouse smoothing and inertia if (!ItemInstance.beingDragged) { SetStartVars(); ItemInstance.gameObject.GetComponent <Image>().raycastTarget = false; ItemInstance.beingDragged = true; InventoryInteraction.DragItem(ItemInstance); AudioHost._audio.PlayClip(AudioHost.grabItemSound); } InventoryInteraction.ContinueDrag(ItemInstance, Input.mousePosition); transform.position = Input.mousePosition; float heightOFfset = ItemInstance.GetComponent <RectTransform>().rect.height / 2; float widthOFfset = ItemInstance.GetComponent <RectTransform>().rect.width / 2; Vector3 adjustedMousePos = Input.mousePosition; adjustedMousePos.y -= heightOFfset; adjustedMousePos.x -= widthOFfset; ItemInstance.GetNewGridPos(InventoryInteraction.getGridPosFromScreen(adjustedMousePos)); }