Get img position always returning x0y0

Problem - Returns x: 0, y: 0

The position always ends up at the top left corner.

I’ve tried to make Canvas Panel a direct parent towards IMG Normal Currency to no avail.

What can i do to work around this problem?


By default, objects dragged onto the canvas are anchored to the top left corner. Maybe your image is anchored there and you’ve used an offset to position it on screen? What are you hoping to accomplish exactly?

So it seems like you might be on to something. When i changed the default anchor to center (and i also added back the canvas as parent - view hierarchy), and it seems to finally update the location.

HOWEVER - it only takes its parents coordinates to consideration.
So if i were to center my anchor, it would move within just 20-30 coordinates.
This ended up with my floating text, rendering back to the upper-left corner as per x0, y0 coordinates, although with the slight difference of 20-30 units.

So now the question remains… how do i take the main viewport into consideration…

Which is why I ask my original question again. What are you trying to do? Why do you need to get the X Y position of the image? Maybe there’s an easier way to accomplish what you want.

Ah sorry, i must have glaced over your question.

I’m lerping a UI widget to an x,y coordinate.
When collecting money, i want the money to fly towards my IMG.
The functionality is there however, the coordinates are not.

And that’s currently where i’m at.