I had a UI button dragging and dropping fine. I then set Canvas scaler to scale with screen size and it has broken the gameobjects position. It appears the position is being scaled up, because when I go to the very bottom left of the screen the object will appear but as I go up and right it scaled to about x position = 120000 and y position = 66000.
I have logged the actually values for eventData.position and it is the same as before, between 0 and 1000 roughly. I can only assume that something is changing the value after my code fires. I have played around with scaling setting but had no luck in fixing the issue.
This is the code I’m using.
public void OnDrag(PointerEventData eventData){
Debug.Log("Dragging");
this.transform.position = eventData.position;
}