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

Why is my animation broken?

Asked by 7 years ago

I have a fireball animation(which btw is terrible) but it will not work and idk why this is the output -- 15:43:12.942 - Unable to cast value to Object

Animation = script:FindFirstChild("Animation")
player = game.Players.LocalPlayer
hum = player.Character.Humanoid
mouse = player:GetMouse()

mouse.KeyDown:connect(function(key)
    local debounce = false
    local animTrack = hum:LoadAnimation("FireBall")
    if key == "f" and debounce == false then
        debounce = true
        animTrack:Play()
        wait(.1)
        debounce = false
    end
end)

Answer this question