Animation Not Playing

I need help figuring out why my animation isn’t playing, there are no error codes, the animation and baseplate are both R15, and the animation is published to the same group as the game. The animation is a weight lifting animation that is lifting an arrow instead of a weight.

When I load into the play in Roblox studio, the strength goes up but the animation won’t play.


I looked on Youtube, google, developer hub, and I tried everything for two hours, I can’t find a solution.

1 Like
local tool = script.Parent -- Assuming the script is placed inside the tool
local animationId = "INSERT_ANIMATION_ID_HERE" -- Replace with the ID of the animation you want to play

local toolEquipped = false -- Variable to track if the tool is equipped

local function playAnimation()
    -- Check if the tool is equipped and animationId is valid
    if toolEquipped and animationId ~= "" then
        local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
        local animator = humanoid:FindFirstChildOfClass("Animator")

        if animator then
            -- Load the animation
            local animation = Instance.new("Animation")
            animation.AnimationId = "rbxassetid://" .. animationId

            -- Play the animation
            local track = animator:LoadAnimation(animation)
            track:Play()
        end
    end
end

-- Handle tool equipped/unequipped events
tool.Equipped:Connect(function()
    toolEquipped = true
end)

tool.Unequipped:Connect(function()
    toolEquipped = false
end)

-- Detect mouse click
game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
    playAnimation()
end)

Make sure to replace "INSERT_ANIMATION_ID_HERE" with the actual ID of the animation you want to play. Place this script inside the tool you want to use and it will play the animation when the player clicks the screen while holding the tool.

2 Likes

I tried that and even tried using this exact script but no matter what the animation never plays. Every time I’ve ever tried applying an animation this always happens.

I figured it out! Thanks for your help anyways.

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