Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you weld an object to the character without causing movement issues?

I'm trying to create a melee weapon with a "damage radius" around the player. The welding however, causes the player to glitch out every time I use the weapon. Any help?

	local DamageObject = Instance.new("Part")
	DamageObject.Parent = workspace
	DamageObject.Name = Player.Name.."'s DamageObject"
	DamageObject.Shape = Enum.PartType.Ball
	DamageObject.Anchored = false
	DamageObject.CanCollide = false
	DamageObject.Size = Vector3.new(10, 10, 10)
	DamageObject.Position = workspace[Player.Name].UpperTorso.Position
	
	local weld = Instance.new("Weld")
	weld.Parent = DamageObject
	weld.Name = "Weld"
	weld.Part0 = workspace[Player.Name].LowerTorso
	weld.Part1 = DamageObject
	weld.C0 = workspace[Player.Name].UpperTorso.CFrame:Inverse()
	weld.C1 = DamageObject.CFrame:Inverse()
	
	DamageObject.Touched:Connect(function(Part)
		local Humanoid = Part.Parent:FindFirstChild("Humanoid")
		if Part.Parent:FindFirstChild("Humanoid") and table.find(IgnoreList, Part.Parent.Name) == nil then		
			if Part.Parent:FindFirstChild("Died") == nil then
				ReplicatedStorage.DamageEvent:Fire(Player, Part.Parent.Humanoid, 25)
				table.insert(IgnoreList, 1, Part.Parent.Name)
			end
			
			if Humanoid.Health <= 0 then
				local DeathMarker = Instance.new("Folder")
				DeathMarker.Name = "Died"
				DeathMarker.Parent = Part.Parent
			end
		end
	end)
	
	wait(0.5)
	DamageObject:Destroy()
	IgnoreList = {}

1 answer

✓ Accepted answer

you could make the part massless, i have done that before it works.

part.Massless = true

1 comment

0

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.