Setting position through scripts between 2 ui elements of different hierarchies.

How can I set my UI object @ the same position than another UI object.

I want to move this red arrow over to the last circle of the Grid Layout.
The arrow and the circles don’t share the same hierarchy of objects, but they share a same canvas.

Using the code below makes me very far off the target.
I would like to have a method that takes 2 Rect Transforms and puts them on each other so that I have to avoid headaches in the future every time I want to move a UI element to another one. Maybe some of you know how to do this?

        ArrowSpot.gameObject.SetActive(true);
        var pos = UISkill.GetLastSkillAcquired().RectTransform.position;
        var rectTransform = (RectTransform)ArrowSpot.transform;
        rectTransform.position = pos;

@FeastSC2

Sorry if I read your post too quickly, but if you need to place a RectTransform over another, that is on the same Canvas, but has a different parent you can do just this:

itemRt.position = placementRt.position;

This works if you have Screen Space or Screen Space Camera Canvas. I usually use Canvas Scaler with “Scale with Screen size” mode, but I guess it could work in other modes too.