Store position over scrolled panel

Hi
I have a few buttons over a scrolled panel.
NOT using the layout. they each have its own position over the panel.

  1. i take one of the elements out to another panel.

  2. i move the panel up

  3. I snap the element out of the other panel, it is automatically snaps (in lerp)
    Back to its old position

Problem:
the old position is “floating” over the originaly moved panel, the button return to a poisition which is not mover another element.

What is the right way to calculate the element original position to change after i move the panel up / down ?

thanks

You can try to store the new current position via Update function.

Here are some excample for you:

    float curCoordinatesX = CurScroller.GetComponent<RectTransform>().anchoredPosition3D.x;
    float curCoordinatesY = CurScroller.GetComponent<RectTransform>().anchoredPosition3D.y;
    float curCoordinatesZ = CurScroller.GetComponent<RectTransform>().anchoredPosition3D.z;