In Unity 2021 LTS, why in the world am getting the global position of a UI object when I access its rectTransform.localPostion.y?
In the inspector I see the local y position of a RectTransform
But when I turn on debug mode, y shows the global position, which is the value returned by localPostion.y:
What is going on with that?
Wrong sub forum. This is the sub forum for the new UI toolkit, not the old uGUI.
In any case, local position != the editor friendly values displayed by the rect transform.
Local position is a property of Transform, of which RectTransform inherits from. You would want to use probably anchored position or the other rect transform specific values: Unity - Scripting API: RectTransform