Attachment CFrame Don't work Correctly

I’ve been trying to fix this problem for a whole day, I’m super stressed I tried to do a thousand things but none of them worked :pensive:

The problem is that I want to weld a Model to my Tool, but when welding it the correct position does not appear

Code:

Remotes.EquipAttachment.OnServerEvent:Connect(function(player, Tool, SightModel) 
	if SightModel.Type.Value == "Sight" then
		
		local NewAtt = SightModel:Clone()
		NewAtt.Parent = Tool.Attachments.Sights	
		NewAtt.Main.CFrame = Tool.BodyAttach.SightPos.WorldCFrame
		
		local Weld = Instance.new("WeldConstraint", NewAtt)
		Weld.Name = "AttachmentWeld"
		Weld.Part0 = NewAtt.Main
		Weld.Part1 = Tool.BodyAttach
	end
end)

Tool.BodyAttach.SightPos.WorldCFrame is a Attachement

SightModel
1

Tool.BodyAttach
2

I feel like I’m doing something wrong but I don’t know whaaaaaaaaaaat
(Anything helps! :cowboy_hat_face:)

Btw the script is in the server.

Where would sightpos be located? WorldCFrame is the cframe of an object but free of it’s parent.

There is SightPos Is a Attachment

Can you click it and see where it is located?

Where would you expect it to be located?

Captura de pantalla 2022-08-21 051911
There

Try motor6d instead? If it that does not work then try changing WorldCFrame to CFrame.

I try to use a Motor6D, but what it does is put it in the position of the bodyAttach. I change the WorldCFrame to CFrame, I also tried it with the Weld from before
Neither of them worked…

stressed

Instead of setting the part’s CFrame to something, can you do this?:

-- I'm assuming you already have a primary part setup, of which, is the part named "Main".
Model:SetPrimaryPartCFrame(ourCFrame)
1 Like

The same problem happens

Like this right?

	local NewAtt = Attachment:Clone()
	NewAtt.Parent = Tool.Attachments.Sights	
	NewAtt:SetPrimaryPartCFrame(Tool.BodyAttach.SightPos.WorldCFrame)
	--NewAtt.Main.CFrame = Tool.BodyAttach.SightPos.WorldCFrame
		
	local Weld = Instance.new("WeldConstraint", NewAtt)
	Weld.Name = "AttachmentWeld"
	Weld.Part0 = NewAtt.Main
	Weld.Part1 = Tool.BodyAttach

And yes my sight have a PrimaryPart set, which is Main

Tey using RigidConstraints much easier than welding.

The issue seems to be weld constraints server to client issue which I have seen before.

I have never used RigidConstraint but what I did was add an Attachment to “Main” and put it as Attachment1 and the BodyAttach as Attachment0 but when equipping the gun it seems that it did not weld and it falls off the map or I think so because after a few seconds disappears

Remember to parent,

Otherwise follow something similar to below:

Weld method with attachments:

Rigid constraint method:

I fix it, but I had to change things on my weapon :confused:
Change the Attachment(“SightPos”) to a part, and change the WeldConstraint to a Weld.
If anyone has the solution for some reason, I’ll change it and mark it as a solution