I’m confused about Unity’s coordinate system. I’m working on a game that is only UI (everything is an Image/RawImage on a canvas).
My screen size is 1920x1080. I set a Vector3 to place an image slightly off screen through RectTransform, like this:
airportOffScreenLocation = new Vector3(1060, 0, 0);
plane.GetComponent<RectTransform>().anchoredPosition = airportOffScreenLocation;
With this code, Unity seems to put 0, 0 as the middle of the screen. So this code places the image about 100 pixels to the right of the screen.
But then I try to move the plane to the exact same position with this code (using DOTween):
plane.transform.DOMove(airportOffScreenLocation,2f);
Instead of the plane staying stationary, it flies to a point on the screen. DOTween seems to put 0, 0 at the top left of the screen.
Does anyone know why there the coordinate system is different in these two cases?