Positioning a part into the "Hand" of an npc using attachments

Basically what I am trying to achieve, is when an NPC walks up to a counter, a cup appears in its hand.
I am trying to achieve this by cloning a cup part which has an attachment attached to it, and moving the attachment to the position of another attachment placed on the NPCs ‘Hand’, which should move the cup, right? Well, I tried using Attachment1.CFrame = Attachment2.CFrame and attachment1.Position = Attachment2.Position, but this just offsets the attachment relative to the cup, and does not move the attachment1( cup attachment) to attachment2 (hand attachment). How can i make the cup attachment move to the hand attachment to place the cup in the NPCs hand?

Rigid constraints should be the newest and easiest way of doing it without needing any work with welds.

However the weld approach should be the same.

local weld = Instance.new("Weld")
weld.C0 = attachment1.CFrame
weld.Part0 = attachment1.Parent
weld.C1 = attachment2.CFrame
weld.Part1 = attachment2.Parent

weld.Parent = attachment1.Parent
2 Likes