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:
-- 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?