Object not welding to animation

I created an animation and scripted it so that when a player equips the ball tool, the animation plays and they dribble with the ball. When the tool is equipped, the animation plays successfully, but the ball does not weld to the character for some reason. Here are my scripts:

image

-- Script
game.Players.PlayerAdded:Connect(function(plr)			
	plr.CharacterAdded:Connect(function(char)		
		local M6D = Instance.new("Motor6D", char.RightHand) -- or the part that you have decieded
		M6D.Name = "ToolGrip"

		char.ChildAdded:Connect(function(child)
			if child:IsA("Tool") and child:FindFirstChild("BodyAttach") then
				M6D.Part1 = child.BodyAttach
			end
		end)
	end)
end)
--LocalScript
local anim = Instance.new("Animation", script.Parent)
anim.AnimationId = "rbxassetid://12963424741" -- id here

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local load = char:WaitForChild("Humanoid"):LoadAnimation(anim)
script.Parent.Equipped:Connect(function()
	while true do
		wait(0.49)
		load:Play()
	end	
end)

script.Parent.Unequipped:Connect(function()
	load:Stop()
end)

Does anyone have any advice on how to fix this issue?

2 Likes

Do you have videos of the object welded for animation?

(ignore the fast dribbling I’ll fix that later)

In your script, it seems you only set the M6D Part1 Value but not the Part0. That’s probably why the ball isn’t attached to your character.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.