Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved]How can I fix my animation script?

Asked by 5 years ago
Edited 5 years ago

I used this script to play an animation:

local function equip()
    equipped = true

    --//Get humanoid
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoid = character:WaitForChild("Humanoid")

    if humanoid then
        --//Load animations
        pcall(function()
            --//Hold animation
            holdTrack = humanoid:LoadAnimation(holdAnim)
            holdTrack:Play()
        end)
end
end

But I get this error: 10:12:27.271 - Animation failed to load in "Workspace.CaptainD_veloper.Assualt Rifle.Animations.Hold.AnimationId": Animation failed to load

0
Make sure 'holdAnim' is correct and is the Animation object with the id. Could also be because you don't own the animation. xPolarium 1388 — 5y
0
Oh thats probably why. :P CaptainD_veloper 290 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

My educated guess is that you do not own the animation. Make sure you own it or if it is a group game your group owns it. Don't use animations that are not yours.

0
Yeah, thats why. CaptainD_veloper 290 — 5y
Ad

Answer this question