World space canvas render mode and rect transform position

Hi, I am developing a 2D game and the main canvas’ render mode is set to World Space. The main camera is placed in the middle of the canvas.

I am trying to get the Y position of an object’s RectTransform using GetComponent().position.y, however, the value I got was different to the pos Y value I see in the Unity Editor. Specifically, the value I got through the code was as though the object’s anchor is in middle centre, but I want its position in left top anchor mode. Is there a way to get this?

This is the 2D forum for 2D features. UI related stuff can be posted here.