Issues with weld constraints

I am currently trying to fix an issue with using weld constraints. The neon part is supposed to weld on to the part that it touches yet as shown in the image, it looks like it is getting welded before it even touches the part. (I’m using a touched event so it shouldn’t even happen)

sword.Touched:Connect(function(hit)
							if not (hit.Name == "Sword1" or hit.Name == "Sword2" or hit.Name == "Sword3" or hit.Name == "Gate" or hit.Name == "Spear" or hit.Parent == character or hit.parent.Parent == character) and gate then
								debris:AddItem(bv,0)
								local weld = Instance.new("WeldConstraint")
								weld.Parent = sword
								weld.Part0 = sword
								weld.Part1 = hit
								sword.CanTouch = false
								wait()
								local rope = sword:FindFirstChild("RopeConstraint")
								if gate:FindFirstChild("Attachment") and rope then
									rope.Attachment0 = gate.Attachment
									rope.Attachment1 = sword.Attachment
								end
								rope.Length = (hit.Position - gate.Position).Magnitude + 0.5
								rope.Enabled = true
								local sound2 = game.ReplicatedStorage:WaitForChild("Stab"):Clone()
								sound2.Parent = sword
								sound2:Play()
								debris:AddItem(sound2,sound2.TimeLength + 0.2)
								swordfx(false)
							end
1 Like

A clip of the issue
I added a print statement to see which part it was touching and getting welded to to make sure it wasn’t the other neon part.
I’ve also noticed that the part that the spear is welding onto is like ‘flickering’ or 'rubberbanding once it firsts welds.
https://gyazo.com/97f0f6c2d72bef8664a7bb0d6f8bb2f0

1 Like

decrease the speed of the bullet .
roblox’s physics engine is bad so it basically trys to pre-calculate when the bullet touches the part.