How do I properly position attachments?

I’m having alot of troubling positioning attachments onto a certain part, and I set the attachment’s position to the position of the part and it like 15 studs away and 15 studs in the air, I don’t get why it’s doing this.

Code :

function Added(plr)
	local L = game.ServerStorage.webShooterL:Clone()
	local R = game.ServerStorage.webShooterR:Clone()
	plr.CharacterAdded:Connect(function(char)
		print(plr.Name .." likes pancakes!")
		local armL = char:FindFirstChild("Left Arm")
		local armR = char:FindFirstChild("Right Arm")
		local function Weld(name, parent, part1)
			local Straint = Instance.new("WeldConstraint")
			Straint.Name = name
			Straint.Parent = parent
			Straint.Part0 = parent
			Straint.Part1 = part1
		end
		local function Attachments(armcframe, arm, name)
			local Attachment = Instance.new("Attachment")
			Attachment.Name = name
			Attachment.Position = armcframe + Vector3.new(0,-15,2)
			Attachment.Parent = arm
			Attachment.Visible = true
		end
		L.Parent = armL
		R.Parent = armR
		Attachments(armL.Position, armL, "AttachLeft")
		Weld("weldL", armL, L)
		Weld("WeldR", armR, R)
		L.CFrame = armL.CFrame + Vector3.new(-.3,-.8,0)
		R.CFrame = armR.CFrame + Vector3.new(.3,-.8,0)
		print("Working!")
	end)
end

An Attachment’s Position property is relative to its parent’s position, so you can just set the position to 0, -15, 2 or you can alter its WorldPosition property, which is relative to the world:

Attachment.Position = Vector3.new(0, -15, 2)
8 Likes

I’ve tried world position and it has done the same thing I just tried you line of code and it still hasnt worked

image

Rare, I GOT IT WORKING, I just needed to set the Vector position to 0,0,0 and it fixed it thanks! I didn’t know it was actually relative to the parent position!

1 Like