Converting a RectTransform.anchoredPosition to World Position

Hello,

Because of a bug that would be a bit complicated to explain. myObject.position (which is a Rect Transform) returns a weird value. However, myObject.anchoredPosition seems to return the correct value.

How can I convert it?

For reference, my Rect Transform object is a panel in my ScrollRect’s content.

Are you sure they’re “weird” or just not what you expected? :slight_smile:
anchored position might be want you want, I mean.

position is the world position, in meters. RectTransform inherits from Transform, so position is just the regular old position.

A confusing thing is that it’s often the position in pixels or very close (an 800x600 canvas is also 800 meters by 600 meters in the game world.) It’s off a little depending on the canvas scale and origin.