Image position not updating.

I’m updating the position of a panel via script. If I set the panel to active then set the position at the same time this happens.

Here the rec transform is in the correct position (the white square outline) but the image on the panel is in the old position (black square).

If it is already active and I set the position then everything updates correctly.

How can I get the image to update when setting the position?

1 Like

Got the same issue, and did not find any way to fix it.
It only appeared after upgrading from 5.x to Unity 2017.

:frowning: The same problem that I encountered may also be.
I use 2017.1.2f1.

Similar problem but with the source image. It’s not updating when I set the sprite to something else when the parent object is not active (the source image in inspector is correct though)

try like this
_panel.anchoredPosition3D = new Vector3(_panel.anchoredPosition3D.x, _panel.anchoredPosition3D.y, 0);

_panel.anchoredPosition3D = new Vector3(_panel.anchoredPosition3D.x, _panel.anchoredPosition3D.y, .1f);
it works for me

Hi ! I’ve a similar issue described in this post (Unity 2020.3.15) : UI Graphics doesn't update when changing RectTransform values in editor script

If someone have an idea ?

Thanks !