WorldModel not welding hats to rig

I’m trying to add accessories to a ViewportFrame in a WorldModel. However, accessories don’t weld to the character. When I looked up fixes, I couldn’t find anything or it would redirect me to a WorldModel in which I’m already using. Parenting an accessory in studio works, but when I clone an accessory in-game it flat out doesn’t weld to the character.


I’m not the biggest fan on having to manually weld a hat each time. Is this a bug with WorldModels or does this just not apply to cloning hats to the Rig?

Ok I fixed it. Just manually add in the weld like so

local nS = <Hat Instance>
local vpRig = <Rig Instance>

local accessoryweld = Instance.new("Weld")
				accessoryweld.Name = "AccessoryWeld"
				local Attachment = nS:FindFirstChildWhichIsA("BasePart"):FindFirstChildWhichIsA("Attachment")
				
				if Attachment then
					local bodyAttachment = vpRig:FindFirstChild(Attachment.Name, true)
					
					if bodyAttachment then	
						local partToCFR : BasePart = bodyAttachment.Parent
						accessoryweld.Part0 = partToCFR
						accessoryweld.Part1 = nS:FindFirstChildWhichIsA("BasePart")
						accessoryweld.Parent = nS:FindFirstChildWhichIsA("BasePart")
						
						accessoryweld.C0 = bodyAttachment.CFrame
						accessoryweld.C1 = Attachment.CFrame
					end
				end