Hi,
I have a Graphic Node called “clone” and a graphic node called “anchor”. What I am trying to do is move clone to the exact coordinates as that of anchor. I also want to add clone as the child of anchors parents, so that they are at the same hierarchy. What I do is:
clone.removeFromParent();
anchor.parent.addChild(clone);
clone.translation = {x: anchor.globalBounds.x, y: anchor.globalBounds.y};
It works well if the parent of anchor is the root object. But when anchor is inside an artboard, clone gets displaced by the global x value of the artboard (clone x= anchor x-artboard x). Things get even more displaced when I put the anchor object inside a group inside multiple levels of groupings. I am unable to place clone at the exact position as anchor at the exact hierarchy as anchor. Please help.