I am attempting to play an animation that contains a welded basketball. The basketball is on the court, when a player touches it, it welds to their RightHand (R15) and should play the animation. Upon testing, it turned out that the ball welded correctly, but the animation did not play. Any ideas on how to modify the script or anything in the explorer for it to work? Thanks!
Script:
script.Parent.Touched:Connect(function(Hit)
if script.Parent.Parent.Parent.Parent.StarterPlayer.StarterCharacter:FindFirstChild("RightHand") and not script.Parent.Parent.Parent.Parent.StarterPlayer.StarterCharacter:FindFirstChild(script.Parent.Name) then
if script.Parent.CanPickup.Value == true then
script.Parent.CanPickup.Value = false
script.Parent.CanCollide = false
local RightHand = script.Parent.Parent.Parent.Parent.StarterPlayer.StarterCharacter:FindFirstChild("RightHand")
script.Parent.Motor6D.Part0 = RightHand
script.Parent.Motor6D.Part1 = script.Parent
script.Parent.Parent = RightHand.Parent
RightHand.Parent.PickedUpBall.Value = true
local anim = game.StarterPlayer.StarterCharacter.Animations.DribbleR_Final
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
end
end
end)
Explorer:
Note: All scripts in StarterCharacterScripts are disabled.