I made an animation for picking up a snowball, but it doesn’t play. I exported and saved it on Roblox. When I checked it on the Roblox website it did play (because I have a Chrome extension that plays Roblox animations). But when I loaded into Roblox and played the animation track it just doesn’t play. I own and animation and I tried reloading assets and restarting studio, but it still doesn’t work.
Here’s my code:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local Snowball = game.ReplicatedStorage:WaitForChild("Snowball")
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local SnowballPickupAnimation = Instance.new("Animation")
SnowballPickupAnimation.AnimationId = "rbxassetid://2475244717"
local SnowballPickupAnimationTrack = Humanoid:LoadAnimation(SnowballPickupAnimation)
local clone = Snowball:Clone()
clone.CanCollide = false
clone.Anchored = false
clone.CFrame = Character:WaitForChild("Right Arm"):WaitForChild("RightGripAttachment").CFrame
clone.Parent = Character["Right Arm"]
clone.Name = "Handle"
for i,v in pairs(clone:GetChildren()) do
v:Destroy()
end
local weld = Instance.new("Weld")
weld.Part0 = clone
weld.Part1 = Character["Right Arm"]
weld.C0 = CFrame.new(0, 1, 0)
weld.Parent = clone
local hasBall = false
UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and not hasBall and ((HumanoidRootPart.Position - Vector3.new(0, 3, 0)) - Mouse.Hit.Position).Magnitude <= 3.5 and (Mouse.Target.Name:match("Snow") or Mouse.Target.Name:match("snow")) then
SnowballPickupAnimationTrack:Play()
print("pla")
end
end)
Anything helps, thank you!