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

how do i make a weld follow the players movement?

I am trying to make a katana weld at the players lower torso, which i have done already, however when the player is walking or jumping it stays in a stiff position. How would i write a script that makes it follow what the player does? my script:

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local katana = script.Katana:Clone()
		katana:SetPrimaryPartCFrame(Character.LowerTorso.CFrame)
		katana.Parent = Character
		
		local weld = Instance.new("ManualWeld")
		weld.Part0 = katana.PrimaryPart
		weld.Part1 = Character.PrimaryPart
		weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
		weld.Parent = weld.Part0
	end)
end)

1 answer

to get the katana to move relative to what you've connected it to you're gonna have to use a Motor6D, not a weld. from there you can use the inbuilt roblox animation editor to animate its movement.

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