Lerping RectTransform to a different anchor?

Hello!

I was using a series of lerps to change a RectTransform position, size, and anchors to another target RectTransform. But after testing it the lerp appears jittery because of the constantly changing anchors. To simplify things I can use just the size and position, but the problem is if I do it that way it won’t work on smaller / bigger resolutions devices.

Is there a way to convert the position of RectTransform to a different target anchor? In other words keep the objects position and size relative to the screen while changing the anchor?

I noticed that in the Unity Editor it does this automatically when you change the anchors (it keeps the objects positioning), but upon scripting the functionality it resets the position.

Any help would be much appreciated!

Thanks!

Try lerping with the RectTransform’s .offsetMin and .offsetMax