public void OnEndDrag(PointerEventData eventData) { CheckForOverlap(); //We want a very final check just to be sure //If you've landed on a hotkey slot if (parent.tag.Equals("Hotkey")) { hotkeyController.DraggedToHotkey(parent, skillID.skillID, Hotkey.HotkeyType.SKILL); //Update the UI with what we've just added objDragged.transform.SetParent(parent, false); //Set this objects parent to the hotkey slot objDragged.transform.localPosition = Vector3.zero; //Make it line up in the middle objDragged.transform.SetAsFirstSibling(); } else { Destroy(objDragged); //If you've dragged it somewhere else, nothing happens. } //Reset our variables for the next time parent = GameObject.FindGameObjectWithTag("HotkeyWrapper").transform; dragging = false; }